[thelist] How important is height when using tables?

Kasimir K evolt at kasimir-k.fi
Fri Jul 30 03:19:21 CDT 2004

Johnson, Christopher (MTO) wrote on 29/07/2004 21:37:
> Just a quick question that I have been wondering about for the last few
> days. When design a site using tables for the layout, how important is it to
> state a table and/or cell height? Is there any speed gained in telling the
> browser the height of a cell versus not when it comes to rendering a table?
> Is there underlying reason to leave the height attribute off when working
> with tables?

According to HTML 4.01 tables do not have height attribute, only width:

And for TD both width and height are deprecated:

And if you want to use CSS to specify height, it's good to bear in mind, 
that "CSS 2.1 does not specify rendering when the specified table height 
differs from the content height"

So I wouldn't try explicitly specifying height, as the result might be 
what expected. Instead I'd rely on content, padding, border and spacing 
of the table cells.

If you are in a situation where you have to use tables for layout, then 
using spacer gifs is not the greatest sin :-)

If you are concerned about the rendering speed, you could make sure, 
that there are no unnecessary nested tables.

Seth Thomas Rasmussen wrote on 30/07/2004 0:22:
> Yeah, and that's setting aside the fact that there is all but absolutely no
> reason to use tables for layout anymore. Period.

Seth, you probably missed Christopher's P.S.:

> P.S. I know that when it comes to design one should use css and not tables,
> but I am just a lowly co-op student working on a site that is not of my
> creation. Thus, it is not my place to change the way this company does
> things. So no comments about why tables are bad and how I should be using
> css.


More information about the thelist mailing list