[thelist] keeping table cells closed in NN 6.0

James Aylard jaylard at encompass.net
Fri Jan 26 02:16:31 CST 2001


Rudy,

>   Does Netscape 6 Break Your Table Layouts?
>   http://evolt.org/article/Netscape6/17/4427/index.html
>
> i have read it a couple times, including the comments, and i'm still not
> sure which DTD i should be using -- i've always used the "long" one but
> according to dogfood's comments, netscape 6 isn't picking it up correctly
> (it's "too long"!)

	Since I wrote that article, I have to accept a good share of the blame for
the confusion. When I initially posted the article, I was satisfied that,
after extensive experimentation, I had discovered the cause of and cure for
Netscape 6's table-alignment problems. Further reading that I did shortly
after I posted the article suggested that, in fact, I had gotten it wrong.
	My current understanding, based both on experimentation and further
reading, is that I identified the general problem correctly (Netscape 6's
handling of the Transitional DTD messes up pixel-precise table layouts), and
got a good, workable solution to the problem in a round-about way: by using
a technically correct document type declaration (which is legitimate and
passes muster in the W3C validator), Netscape 6 displays the table layouts
correctly.
	What I didn't initially understand was that my solution worked essentially
because of a limitation in Netscape 6: it does not recognize as valid any
Transitional document type declaration other than the one that is hard-coded
into its programming. As a result, when a different document type
declaration is used, it applies a "quirks" mode processing -- rather than a
standards-mode processing -- that renders the tables gracefully.
	My gripe with the Mozilla team is that I believe they have gotten their
standards-mode processing wrong when it comes to table cells. The Mozilla
team claims that it is applying the standards laid out in the CSS 1 and CSS
2 recommendations in their treatment of tds, assigning them a default
"display" value of "inline", much like a span. However, CSS 1 says
absolutely nothing about tables, and CSS 2 creates an entirely new "display"
property value of "table-cell" -- rather than "inline" -- as the default
value for a td. Why does it matter? Well, CSS 2 specifies line-height rules
for inline elements that don't apply to block elements (or table-cell
elements, as far as I can tell). As such, they apply default "line-height"
rules to tds that I think are inappropriate, and which break pixel-precise
table layouts.
	So, if you re-read my article, use the DTD that I recommended -- even
though I got the reason for using it wrong. Keep this in mind: it is valid.
It is standards-compliant. And due to the hard-coded myopia of Netscape 6,
it allows the page to render
in "quirks" mode, bypassing the Mozilla team's faulty understanding of a
table cell's display properties.

James Aylard





More information about the thelist mailing list