Forum Moderators: open

Message Too Old, No Replies

Netscape 4 bug mixing Tables and Divs

I found a fix

         

tedster

9:36 pm on Feb 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just stumbled on a workaround that is helping several of my pages to render properly on NN4. The problem comes up when I need to include tables (real ones with data) within a position:absolute div.

In general, NN4 is really buggy when this happens. At best it forgets styles after a table, which is easily fixed with some redundant styles. At worst it throws display elements all over the screen, overlapping text and images. What a friend of mine calls a "dog's breakfast".

I found that placing the tables within their own div tags works wonders. Instead of this:

<div id="absolute">
<p>Content content content.
<table></table>
<p>More content.
</div>

I do this:

<div id="absolute">
<p>Content content content.
<div>
<table></table>
</div>

<p>More content.
</div>

In every case so far, the layout snaps back to where I intended. I'm guessing the extra div tags give Netscape just enough extra information to render things correctly.

(edited by: tedster at 9:47 pm (utc) on Feb. 12, 2002)

MikeFoster

10:51 pm on Feb 11, 2002 (gmt 0)

10+ Year Member



Excellent tip tedster!

It does seem to make a difference.