IE Div margins incorrect when inside nested tables

C

Chris Beall

The minimized example below says it all.

Chris Beall

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
<TABLE>
<TBODY>
<TR>
<TD>
<TABLE>
<TBODY>
<TR>
<TD>
<div style="color: black; margin-left: 10%; margin-right: 10%;">
<p>
This text should be bounded by a 10% margin on each side of the window.
This works in Netscape 7.1, but not in IE 5.5. The distinguishing
characteristic of the source HTML is that this Division is inside two
nested tables. This raises two questions. First, what is wrong?
Second, how can it be compensated for?
</td></tr></tbody></table>
</td></tr></tbody></table>
</body>
</html>
 
C

Chris Beall

Chris said:
The minimized example below says it all.

My example is missing a closing </div> immediately following the
paragraph of test. Doesn't alter the problem...

Chris Beall
 
C

Chris Beall

Toby said:
Chris Beall wrote:




Wow! News at 10... IE 5.x has issues with its box model!

True. I've seen most of them documented somewhere, with workarounds for
many, but I haven't found anything specific to this case. If you have a
reference I would appreciate it.

BTW, the same failure occurs on IE 6.0.2800.1106.xpsp2.030422-1633.

Chris Beall
 
T

Toby A Inkster

Chris said:
BTW, the same failure occurs on IE 6.0.2800.1106.xpsp2.030422-1633.

Well, it would do. The example you posted would trigger quirks mode.
 
C

Chris Beall

Toby said:
Chris Beall wrote:




Well, it would do. The example you posted would trigger quirks mode.

OK, so the <Doctype> triggers quirks mode, which causes IE 6 to
faithfully reproduce the defects of IE 5.5, which includes something
screwy related to nested tables and % width. How convenient.

I ran into this on an EBay auction, where the <div> belongs to me, but
all of the surrounding code is provided (and can only be changed by)
EBay. Dunno why they used Transitional, but a few days ago they had no
doctype at all, so I guess that's progress...

I've come up with a workaround, which is to close the open tables,
process my Div, then open equivalent tables before dropping back into
their stuff. Yuck.

Chris Beall
 
C

Chris Beall

Chris said:
OK, so the <Doctype> triggers quirks mode,
I ran into this on an EBay auction, where the <div> belongs to me, but
all of the surrounding code is provided (and can only be changed by)
EBay. Dunno why they used Transitional,

Correction. EBay uses no <doctype> at all. I was looking at a copy of
the page saved from IE, which apparently INSERTED a Transitional doctype
as a byproduct of copying the page.

Chris Beall
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top