IE Div margins incorrect when inside nested tables

Discussion in 'HTML' started by Chris Beall, Apr 21, 2004.

  1. Chris Beall

    Chris Beall Guest

    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>
    Chris Beall, Apr 21, 2004
    #1
    1. Advertising

  2. Chris Beall wrote:

    > This works in Netscape 7.1, but not in IE 5.5.


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

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Apr 21, 2004
    #2
    1. Advertising

  3. Chris Beall

    Chris Beall Guest

    Chris Beall wrote:
    > 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
    Chris Beall, Apr 21, 2004
    #3
  4. Chris Beall

    Chris Beall Guest

    Toby A Inkster wrote:

    > Chris Beall wrote:
    >
    >
    >>This works in Netscape 7.1, but not in IE 5.5.

    >
    >
    > 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
    Chris Beall, Apr 21, 2004
    #4
  5. Chris Beall wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Apr 21, 2004
    #5
  6. Chris Beall

    Chris Beall Guest

    Toby A Inkster wrote:

    > Chris Beall wrote:
    >
    >
    >>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.
    >


    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
    Chris Beall, Apr 21, 2004
    #6
  7. Chris Beall

    Chris Beall Guest

    Chris Beall wrote:
    > Toby A Inkster wrote:
    >
    >> Chris Beall wrote:
    >>
    >>
    >>> 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.
    >>

    >
    > 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
    Chris Beall, Apr 22, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Owen Jacobson

    Re: div margins?

    Owen Jacobson, Sep 1, 2003, in forum: HTML
    Replies:
    2
    Views:
    505
    Owen Jacobson
    Sep 10, 2003
  2. Andrew Crowe
    Replies:
    3
    Views:
    791
    Andrew Crowe
    Dec 13, 2003
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    743
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    185
    David Dorward
    Jun 1, 2005
  5. 123Jim
    Replies:
    0
    Views:
    140
    123Jim
    May 16, 2011
Loading...

Share This Page