Main Page Content
Does Netscape 6 Break Your Table Layouts
When it comes to installing new software, I'm like a two-year-old at Christmas, excited by the prospect of every new feature, interface widget, and performance improvement promised by the product. The fact that one or more of my childlike expectations is nearly always either partially or wholly disappointed rarely seems to dampen my enthusiasm for the next new product. Yeah, I'm a sucker -- a software sucker.
When it came to installing the release version of Netscape 6, however, my normal enthusiasm for the latest thing was far more reserved, informed by installing and testing numerous Mozilla milestone builds and two preview-release versions of the Netscape-branded browser. My experience had sobered me with the realization that this was a browser of immense promise, but which was traditionally buggy and evolved slowly.
My sobriety proved justified: after installing the release version of the browser, I was perplexed to discover that it added unsightly vertical spacing to pages that I had designed, and broke pixel-precise layouts, undoing hours of my design work without any obvious explanation. This was all-the-more confusing because, as far as I could recall, none of the earlier Mozilla builds or Netscape preview releases shared this problem.
I wrote my pages to be compliant with the HTML 4.01 Transitional DTD, and the W3C validator verified that they were. My page layouts were moderately complex, so I began the process of dissecting them piece by piece to see at what point Netscape 6 balked at displaying them properly. I took away everything that was extraneous including scripting and style sheets, peeled my nested tables apart, and began at the most-basic level of simplicity. Netscape 6 smiled, displaying my basic table correctly.
I re-nested my tables, and still Netscape 6 smiled.
I added back in the CSS, yet Netscape's sunny demeanor remained undiminished.
It wasn't until I added the document type declaration that Netscape frowned and broke my layout. Hmm. "Strange," I thought. I had taken my document type declaration straight from the HTML 4.01 recommendation itself:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
���"http://www.w3.org/TR/html4/loose.dtd">
Nonetheless, the browser treated this fully valid declaration just as if it were a figment of my imagination. Further tinkering finally brought the solution: Netscape 6 apparently only recognizes a single, particular URI within the transitional document type declaration:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
���"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
Although the content of these DTDs is identical, using the URI of the first document type declaration will break the page in Netscape 6 whereas using the URI of the second will prove successful. My pixel-precise table layouts are properly aligned once again. With that solved, Netscape 6 and I are both smiling.