• entries
    1212
  • comments
    1738
  • views
    1140851

HTML minutae part N

Sign in to follow this  

81 views

Ahh yes, it's now part 103 of "The HTML minutae minute", chronicling little bits of HTML that appear nowhere in books that claim to be the "definitive guide" to HTML but apparently are well short of that.

This time it's what to do to make your table bits appear in the right place. In the past, you were told to put a non-breaking space into any empty table cells so that they'd get rendered, because the default HTML table-renderer doesn't have to draw empty table cells.

Well that's all well and good if your table cells are of reasonable size. Many of my tables, however, consist of little 13x13 corner bits, and if the font that your browser chooses to use had a non-breaking space taller than that, your table will have little spaces in it, thus making your tables look uglier than burned mud.

Then you were told to use a slightly better, but no less kludgy method of putting in a 1x1 pixel transparent GIF file into that cell. It'd still get the cell to render, but you wouldn't have to deal with stretchy-font issues.

Finally, you were given the PROPER SOLUTION, which is to put:

table { empty-cells:show; }

into your stylesheet CSS. This is a suggestion to the HTML renderer that it not try to be such a smarty-pants and that it should draw every friggin' cell its given no matter how much it wants to ignore it.

That has been your HTML minutae minute. Go in peace.
Sign in to follow this  


1 Comment


Recommended Comments

What are you using the tables for? If your extra empty cells are because you're using tables for positioning, I'd recommend that you use divs (and accompanying css) instead.

Of course, if you're using tables to organize collections of data, then nevermind, and thanks for the info. :)

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now