first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

HTML: Notes on the TABLE Element

HTML 4.0 Transitional allows TABLE to have the attributes BORDER, CELLPADDING, CELLSPACING and WIDTH (among others). When a TABLE is being used for layout (not for presenting tabular data), a good "default" markup is

<TABLE
    BORDER=0
    CELLPADDING=0
    CELLSPACING=0
    WIDTH="100%">

<!-- Table contents here -->

</TABLE>

where the attributes set to 0 are prevented from rendering unexpected results when, say, setting "margins" with TD elements and transparent GIFs.

Tables can be nested inside tables. This is very useful when you want to make your own buttons using tables instead of those provided by the INPUT element. Also, table nesting, used with BGCOLOR attributes in TD and TH elements, is currently the safest way to format a block of text as a callout or sidebar. I have noticed that Netscape 4.x browsers place background colors (and borders) in TABLE elements far better than in P, DIV and other block-level tags.

mod date: 2000-03-10T06:24:38.000Z