Quick Overview
Internet Explorer 6.0 (and possibly earlier) has a buggy CSS interperter. The biggest problem is the broken "box model", which is documented in enough other places. However, one other major problem is that tables do not inherit div
‘s width. Thus, in my page, which has a left sidebar, if I declare a <table width="100%">
in the main window, it will make the table 100% of the full screen, which, since there’s a sidebar, pushes it off the edge.
Correct In Mozilla (for this layout)
<div id="LeftMenu"">
...
</div>
<div id="Content">
<table width="100%">
...
</table>
</div>
This is exactly what we want. However, it fails in IE.
Correct In IE (for this layout)
<div id="LeftMenu">
...
</div>
<div id="Content">
<div style="width:100%">
<table width="100%">
...
</table>
</div>
</div>
Mozilla also renders this correctly.
Enjoy.
3 responses to “Full Width Tables in IE6”
Thank you thank you thank you. This definitely saved me some headache today!
Thanks Dear, for this solutions of IE. Great. Keep it up
posted 5 years ago and so very helpful! thank you!
Lets all hope that in another 5 years IE6 will be gone and we can forget about this– unlikely though!