Click here to get back home

IE8 Table TD tag and font-size - bug or standard compliant?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
IE8 Table TD tag and font-size - bug or standard compliant? jamieb 04-01-2008
Posted by jamieb on April 1, 2008, 12:43 pm
Please log in for more thread options
Not sure if this is the right spot to post this question or not.
Please let me know.

I've searched high and low for some info about this, but I can't find
anything.

Testing in IE8, I've come across a problem where HTML such as the
following does not work as expected:

<html>
        <body>
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                        <tr>
                                <td background="1x1.gif"><img src="1x1.gif" border="0"></td>
                        </tr>
                </table>
        </body>
</html>

1x1.gif is, as the filename suggests, a 1 pixel gif image. I'd expect
that the TR row would be 1 pixel in height, for the width of the
browser window, but it is not. The only way I can make this row 1
pixel in height is to specify a font-size of 1px or smaller in a style
attribute of the TD element (or remove the img tag within the TD).

Both firefox (latest) and IE7 work as I'd expect them to. Do you
think this is a defect in IE8 or just a part of IE8's new standards
compliance? If I switch to a mode other than Standard through the IE8
developer tool (quirks mode, for example), things are fine.

Posted by Ben C on April 1, 2008, 2:02 pm
Please log in for more thread options
> Not sure if this is the right spot to post this question or not.
> Please let me know.
>
> I've searched high and low for some info about this, but I can't find
> anything.
>
> Testing in IE8, I've come across a problem where HTML such as the
> following does not work as expected:
>
><html>
>         <body>
>                 <table border="0" width="100%" cellspacing="0" cellpadding="0">
>                         <tr>
>                                 <td background="1x1.gif"><img src="1x1.gif" border="0"></td>
>                         </tr>
>                 </table>
>         </body>
></html>
>
> 1x1.gif is, as the filename suggests, a 1 pixel gif image. I'd expect
> that the TR row would be 1 pixel in height, for the width of the
> browser window, but it is not. The only way I can make this row 1
> pixel in height is to specify a font-size of 1px or smaller in a style
> attribute of the TD element (or remove the img tag within the TD).
>
> Both firefox (latest) and IE7 work as I'd expect them to. Do you
> think this is a defect in IE8 or just a part of IE8's new standards
> compliance? If I switch to a mode other than Standard through the IE8
> developer tool (quirks mode, for example), things are fine.

Are you sure you're getting Firefox in strict mode? I would expect the
td to be higher than 1px since it contains an inline image which is
aligned to the baseline of the td.

There should therefore be a gap below the image equal to the font
descent of the td's font.

Set display: block (or vertical-align: bottom) on the img and it should
work as expected in strict mode in all conforming browsers.

Similar ThreadsPosted
Ignore CSS table formatting & use standard HTML? April 6, 2005, 2:02 pm
Standards Compliant Website - And Pocket PC IE June 29, 2005, 9:25 am
Standards-compliant Engineering/Manufacturing Sites January 14, 2005, 1:40 pm
How to construct XHTML-compliant nested list? August 25, 2006, 1:31 am
how to switch on Standards-compliant mode for IE6 when using the trick w3 provided for serving xhtml as application/xml to IE January 22, 2007, 9:23 pm
A Standard Internet Profile September 5, 2006, 1:55 pm
XHTML standard rationale question February 13, 2005, 7:32 pm
Industry standard salary for web designers` April 11, 2005, 9:06 am
Standard character attributes for Hebrew? March 12, 2006, 2:22 pm
Using "standard redirects" so as not to "break the back button" August 22, 2006, 10:44 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap