Table Header/Data Cell

End Tag: Optional
Support Key:
TH: 2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
TD: 2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson [bloo@blooberry.com] =
Main Index | Element Tree | Element Index | HTML Support History


What is it?
The Table Header(TH) and Table Data(TD) elements are part of the original Simple Table Model and are also part of the newer, backward compatible Complex Table Model. These two elements are used to identify table cells for HTML tables. All displayable content in a table will be contained within a TH or TD cell. Header cells are identical to data cells in all respects except common rendering: the TH typical default horizontal alignment is CENTER and text within is made BOLD - TD typical default horizontal alignment is LEFT and text within is unmodified.

Common Attributes
%Core%
2 | 3 | 3.2 | 4 | IE3 | M | N4B2 | O
%Events%
2 | 3 | 3.2 | 4 | IE4B1 | M | N | O
%Language%
2 | 3 | 3.2 | 4 | IE4 | M | N | O

Specific Attributes
Abbr
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This attribute defines an abbreviated name for a header cell. If no abbreviation is listed, the default abbreviation is the cell content.
Values: Alphanumeric characters.
Align
2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
Required? No
Description:
This controls the horizontal alignment of content within the current table cell.
Values: Left | Center | Right
Axis
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This defines a name for a cell and will usually only be applied to TH cells. This allows for a table to be mapped to a tree hierarchy (most useful perhaps in non-visual rendering environments) where the nodes are represented by the axis names and the leaves of the nodes are the data cells of the Axis.
Values: Alphanumeric characters.
Background
2 | 3 | 3.2 | 4 | IE3A1 | M | N4B3 | O
Required? No
Description:
This attribute specifies a background image to be placed in the current table cell. All cell contents will be displayed over this image. If the referenced image is smaller than the table cell size, it will be tiled to fit all of the cell area. The value for this attribute indicates the URL to reference the graphic.
Values: An absolute or relative URL
BGColor
2 | 3 | 3.2 | 4 | IE2 | M3 | N3B1 | O2.1
Required? No
Description:
This attribute sets the background color to be used for the current table cell.
Values: An RGB triplet or a special Color name
BorderColor
2 | 3 | 3.2 | 4 | IE2 | M | N | O
Required? No
Description:
This attribute sets the internal border color to be used for the current table cell. Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: An RGB triplet or a special Color name.
BorderColorDark
2 | 3 | 3.2 | 4 | IE2 | M | N | O
Required? No
Description:
This attribute allows independent, 3-D color control over the upper and left hand borders of the internal cell border color for the current table cell. To change the lower and right hand borders of the internal cell border color for each cell in the current row, use the BorderColorLight attribute (see below.) Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: An RGB triplet or a special Color name.
BorderColorLight
2 | 3 | 3.2 | 4 | IE2 | M | N | O
Required? No
Description:
This attribute allows independent, 3-D color control over the lower and right hand borders of the internal cell border color for each cell in the current table cell. To change the upper and left hand borders of the internal cell border color for each cell in the current row, use the BorderColorDark attribute (see above.) Display of this attribute is dependent on the presence of the BORDER attribute in the TABLE element.
Values: An RGB triplet or a special Color name.
Char
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This attribute specifies a character in the cell content to be used to align the data data in the current cell (the first occurrence should be used.) The default value for this attribute is the decimal point character for the current specified language.
Values: A case-sensitive character within the current character set.
Charoff
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This attribute specifies the spacing offset to the first occurrence of the alignment character (specified by the CHAR attribute) on each line of the current cell. 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.
Values: Integers indicating pixel offset values.
Colspan
2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
Required? No
Description:
Specifies how many cell columns of the table this cell should span. If this attribute is used, no cell information is specified where corresponding cell data would otherwise be in a similar table layout filled with single cells that do not span.
Values: Specified in integers with the default being 1.
Headers
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This attribute specifies the list of header cells that provide header information for the current data cell. This can help in non-visual rendering situations to explicitly bind header information about data cells.
Values:
Space separated list of table cell ID values.
Height
2 | 3 | 3.2 | 4 | IE2 | M | N1.1 | O2.1
Required? No
Description:
Specifies the height of the current cell. A row in HTML tables can only have a single height, so generally this sets the height for an entire row. This attribute is not listed in the Tables specification, and in cases where more than one explicit height is specified for cells in a single column, the outcome is browser dependent.
Values:
Specified in pixels or a percentage of the browser window height.
NOWRAP
2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
Required? No
Description:
This is a standalone attribute which specifies that the data within the current cell will not use normal HTML linebreaking conventions. The table cell will enlarge to fit whatever data is specified in the cell (unless explicit linebreaking tags are added.)
Values: NA
Rowspan
2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
Required? No
Description:
Specifies how many cell rows of the table this cell should span. If this attribute is used, no cell information is specified where corresponding cell data would otherwise be in a similar table layout filled with single cells that do not span.
Values: Specified in integers with the default being 1.
Scope
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
This attribute specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the HEADERS attribute, particularly for simple tables.
Values:
row - Current cell provides header information for the rest of the row that contains it.
col - Current cell provides header information for the rest of the column specified for it.
rowgroup - Current cell provides header information for the rest of the row group that contains it.
colgroup - Current cell provides header information for the rest of the column group that contains it.
VAlign
2 | 3 | 3.2 | 4 | IE2 | M2A8 | N1.1 | O2.1
Required? No
Description:
The VAlign attribute specifies the vertical alignment of the contents of the cell relative to the cell boundaries.
Values: Top | Middle | Bottom | Baseline
Width
2 | 3 | 3.2 | 4 | IE2 | M3 | N1.1 | O2.1
Required? No
Description:
Specifies the width of the current cell. A column in an HTML table can only have a single width and that width used is usually the widest value of all the cells in a column. So, if a width explicitly specified for a cell is smaller than the eventual calculated width of another cell in the column, the larger value will be used instead. This attribute is not listed in the Tables specification, and in cases where more than one explicit width is specified for different cells in a single column, the outcome can be browser dependent.
Values: Specified in pixels or a percentage of the browser window width.
Example
[Using the Simple Table Model]
<table BORDER="2" ALIGN="left" CELLPADDING="5" BORDERCOLOR="#ff0000" 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>
      <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>
      <tr> <th COLSPAN=4>NOTE: This is only a small sample</th> </tr>
</table>
Parent Model
<tr>
Content Model
%In-line Content% | %Block Content%
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...