I am absolutely stunned. For

I am absolutely stunned. For a few months now, I’ve been discovering that some of my websites don’t render correctly on Netscape. Now, like any web designer, I’m aware that none of the major browsers render HTML exactly according to the standards, let alone CSS. So I chalked it up to IE being slightly ahead in the browser wars and blamed Netscape for not being standard-compliant. However, I recently found out that Mozilla also has some problems with some of my sites. This is cause for alarm, since Mozilla’s major feature is an HTML rendering engine that is supposedly 100% compliant. I did a little detective work and found out that all of the bugs could be blamed on Netscape except for one thing. There’s an odd bug that shows up in the way some table cells are rendered on Mozilla (as well as Netscape) that I couldn’t explain away. My code appeared to be correct. Tonight, I stumbled across the answer while working on a new site for work.

There is no HEIGHT attribute for tables or table cells in HTML

Everyone uses height tags in their tables. It’s common practice. But while checking my manuals, I found out that it’s a non-standard tag. There’s a width attribute, but no height attribute. WHY? THIS MAKES NO SENSE.

I stumbled onto this because Netscape would render table cells set to HEIGHT=100% way too large, as if it was setting it to 100% of the screen size, rather than 100% of the space available. And in some circumstances, Netscape would ignore the HEIGHT attribute altogether. IE would render it with 100% of the space available. Mozilla would ignore the height tag altogether in all circumstances. So Netscape and IE had different ways of dealing with this non-standard tag, and Mozilla was the only one doing things the way it was supposed to. The only problem is that suddenly I’m left without a tag that I’ve been using frequently.

And there’s no substitute! Let’s say you want to position an element in the middle of the screen, no matter what size window the viewer has. CSS allows for exacting control over elements, but it will not accept general terms like align right or left or center. You have to enter exact distances from the top left corner. To get around this you need tables. Well, you can set the table cell to 100% width and height, and then align to the center both vertically and horizontally. Well, according to the HTML specs (and therefore, according to Mozilla), you can do that horizontally, but not vertically.

I love web design. It is my passion. But I swear, if anything ever drives me insane someday, it’s going to be things like this.


6 Comments on “I am absolutely stunned. For”

  1. Mr. Bread says:

    That’s why I gave up on style sheets and mostly went back to the ancient html skills I learned back in ‘97, when I was just starting out and IE was still at version 3.2I was psyched when I started reading up on CSS (Cascading Style Sheets) and thought I could position anything anywhere on the page, and change the fonts and color schemes for my entire website by altering a few lines of code on a single reference file.The color/font stuff is true, and I do make use of it. But without a height tag, there isn’t anything CSS would enable me to do that A) I don’t already do with tables, or B) I would be doing anyway.So I returned to the basics, and now everything’s too basic to be snazzy–ever.Next up, I’m going to teach myself flash and really shut people out of my page.THE BREAD SAYS GRRR

  2. urn says:

    Dude, you whine a lot.:)

  3. east side moe says:

    three-two forever, yo!

  4. Simon says:

    Ouch! You’re right. I wondered why this was happening on another site I did, and put it down to NS4 being sucky. I didn’t realise that there was no standard for it.I just knocked up a small test that used both normal height attributes <table height=100%> and CSS attributes <table style="height:100%"> and netiher gived the desired effect. What is wrong with the people that come up with this stuff?You tried nested DIVs and CSS? I’m not sure how much NS4 likes them, as I’m still struggling in that area. Right now I’m almost at the point of serving a different skin for the site, depending on the user agent string. :(

  5. miles_ says:

    man, are you sure there’s not a special DOCTYPE you can set to avoid this? Browsers have different modes of rendering the html, depending…After a little research, I found a page which allegedly tells how to center things in Mozilla:[ October 26th, 2001 at 12:00 am

  6. joshi says:

    the reason that there’s no height is because the height is dynamic - it’s a web *page*, not a screen. sure - it can be annoying but i don’t really care if the splash image on the front of your site is at the top of the page or not, just take me to the content!oh, i dunno, maybe there should be a screen doctype or something.