Full Width Tables in IE6
ח' מנחם אב תשס"ה - August 12, 2005Quick 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.