Re: Misaligned SubMenus in IE6 when inside table
2005/06/05 04:42
Viewed 10159 times
Replies: 1/1
by Ed

Found a workaround...

body { margin: 0; }

Then

<body>
    <div id='contents' style='margin:10px 10px 10px 10px;'>
       * your whole web page goes here *
    </div>
</body>

Not sure what will happen in other browsers, but it is okay in IE6 and Firefox 1.0.2

Let me know if there is a better fix.

Re[2]: Misaligned SubMenus in IE6 when inside table
2005/06/05 17:22
Viewed 11542 times
Replies: 0/0

Not necessarily better, but yes, there's a different workaround. Just embed the menu <ul> in a <div style="position: relative">.

I recently discovered that if you put the menu in a <div style="position: absolute">, IE will also misalign it—but it appears that if it's inside a table it does the trick :-)  So your code becomes:

<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<div style="position: relative">
<ul id="trail-menu">
<li>_Bugger</li>
<li>_Misalign-me
<ul>
<li><a href="/test-201">test-201</a></li>
<li><a href="/test-202">test-202</a></li>
<li><a href="/test-203">test-203</a></li>
</ul>
</li>
</ul>
</div>
</td>
</tr>
</table>

and you don't need to set a "margin: 0" for the <body>, even when the DOCTYPE is present.

This should go in the FAQ as many asked it...

last
Google