0

Here is my code which is working perfect in not IE browsers. The code is the part of the iframe which is loading in JQuery UI Dialogue. Tested In IE 9.

<div style="height:400px;width:400px;overflow:auto">
<table>
<tr>
<td>content</td>

<td>

<div style="position:fixed;height:100px;">
Long Content.............
</div>

</td>
</tr>
</table>
</div>

This is my DOCTYPE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • Do you need the in there at all? Tables, and their content, are treated differently sometimes, and my guess is that 'diplay:fixed' isn't getting applied.
    – chipcullen Feb 10 '12 at 16:55
  • i don't like tables my self but there are more than 100 pages that are following same structure in my project. – Rizwan Mumtaz Feb 10 '12 at 17:00
  • You can't really complain about rendering inconsistencies when you have invalid HTML. – Sparky Feb 10 '12 at 17:09
  • Did you make sure the DOCTYPE is on the first line of your HTML? IE doesn't recognize it if your DOCTYPE is preceded by anything, including an HTML comment. – Artyom Feb 10 '12 at 17:13
  • @Sparky672 okay let change the question. How can i positioned fixed the content inside second TD ? – Rizwan Mumtaz Feb 10 '12 at 17:16

2 Answers2

3

It only works in non-IE browsers because they have better tolerance for bogus code.

Remove the extra <td> inside the <td>, and what in the world are you trying to achieve by putting a position:fixed inside a table cell? For the most part, position:fixed elements should be direct children of the <body> element...

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
  • extra removed. Sir i am trying to achieve position fixed behavior on IE under this scenario. The problem is, i cant change the tables into DIV because there is lot of CODE. – Rizwan Mumtaz Feb 10 '12 at 17:11
0

I don't think nested <td> is valid, you should use another table to nest it.
And then Is a DIV inside a TD a bad idea?.
Don't know why you're using tables but this seems to be possible with divs.

Community
  • 1
  • 1
elclanrs
  • 92,861
  • 21
  • 134
  • 171