HTML Reference Guide

Tag Index| Content List| HTML FAQ



This element is part of the Complex Table Model which allows a finer level of control than the Simple Table Model while maintaining backward compatibility with the simpler model. The THEAD element is part of a trio of table grouping elements that organize a series of Table Rows [TR] into Header [THEAD], Body [TBODY] and Footer [TFOOT] sections.

The THEAD and TFOOT section markers are optional, but one or more TBODY sections are always required. If present, each THEAD, TBODY and TFOOT element must contain one or more TR tag grouping. To allow for backward compatibility with the older Simple Table Model, if no TBODY structures exist in a table, the entire set of row groupings [TR] are assumed to be a single TBODY.

The THEAD section is used to duplicate header information when a table must be broken across boundaries (such as printed pages, etc.) or for use as a static heading when TBODY elements are rendered in a scrolling panel. The THEAD section (along with the TFOOT section) is placed before any TBODY sections in the HTML markup to allow browsers to render the header and footer before receiving all of the Table Body [TBODY] data (in case a table must be broken up.)


align - This controls the horizontal alignment of text within each of the table cells in the specified grouping.

bgcolor - his attribute sets the background color to be used for the current table section (Tbody.)

char - This attribute specifies a character in the cell content to be used to align the data in the current cell. The default value for this attribute is the decimal point character for the current specified language. No handling instructions are given for scenarios with multiple occurrences of the same alignment character on a single line.

charoff - This attribute specifies the spacing offset to the first occurrence of the alignment character (specified by the CHAR attribute) on each line of the cells within the current cell grouping. The direction of the offset is determined by the current text direction (set with the DIR attribute or the BDO element.) In left-to-right scenarios (default), offset is from the left margin. In right-to-left scenarios, offset is from the right margin.

valign - This controls the vertical alignment of text within each of the table cells in the specified grouping.

Example code:

<p><table BORDER="2" ALIGN="middle" CELLPADDING="5" BORDERCOLOR="#ff0000" COLS="4" FRAME="vsides" RULES="rows" WIDTH="75%"><caption ALIGN="top">Juggling Capabilities of Waterfront Performers</caption><tr><th>Juggler</th><th>Pins</th><th>Bowling Balls</th><th>Flaming Baseballs</th></tr></thead><tfoot><tr><th COLSPAN=4>NOTE: This is only a small sample</th></tr></tfoot><tbody><tr><td>Bob</td><td>5</td><td>2</td><td>5</td></tr><tr><td>Larry</td><td>2</td><td>7!!!</td><td>NA</td></tr><tr><td>Julie the Great</td><td>1</td><td>2</td><td>20<br>(She IS great!)</td></tr></tbody></table><p>


Juggling Capabilities of Waterfront Performers
JugglerPinsBowling BallsFlaming Baseballs
NOTE: This is only a small sample
Julie the Great1220
(She IS great!)

See Also: