Definition: Both TD and TH are elements used for table cells. TD is used for data table cells, while TH is used for table header cells. The distinction between the two enables the user agents to differently render such cells. For example, the user agent may use a heavier or bigger font for header cells.
Standard Attributes: CLASS, ID, LANG
COLSPAN, which defaults to 1 (one), lets you merge cells across columns. It is defined as the number of columns spanned by this cell.
ROWSPAN, which defaults to 1 (one), lets you merge cells across rows. It is defined as the number of rows spanned by this cell.
You can use the ALIGN attribute to specify a horizontal alignment of paragraphs within a table row:
* align=left: Renders the paragraph flush left. The default for data cells (TD).
* align=center: Centers the paragraph. The default for header cells (TH).
* align=right: Renders the paragraph flush right.
* align=justify: Allows text lines to be justified where it's practical @md where it's not, it gives the same effect as the align=left setting.
Text lines are indented in a manner that makes the initial appearance of a decimal point on each line vertically aligned. When a line doesn't have a decimal point, it's centered for header cells and rendered flush left for data cells. If the ALIGN attribute isn't present, the default is overridden by the COLSPEC attribute on the TABLE element or the presence of an ALIGN attribute on the parent. The COLSPEC attribute takes precedence over the TR element.
DP indicates what character is to be used for the ALIGN attribute's decimal point @md for example, dp="," or dp="." (this is the default). It is possible to change the default by the language context, as set by the LANG attribute on enclosing elements.
By using VALIGN, you can specify the explicit vertical alignment of the material within a table cell:
* valign=top: Cell contents appear at the top of each cell. This is the default.
* valign=middle: Cell contents are centered vertically in each cell.
* valign=bottom: Cell contents appear at the bottom of each cell.
* valign=baseline: Use this when you want to make sure that all cells in the row with valign=baseline share the same baseline. The only place that this constraint applies is with the first text line for each cell. When the VALIGN attribute is not present, the default may be overridden by the VALIGN attribute's presence on the parent TR element.
You can prevent the browser from automatically wrapping lines by using NOWRAP. If you would like to specify explicit line breaks, you can then do it by using the BR element.
AXIS, which defines an abbreviated name for a header cell, defaults to the cell's content. This name can be used when rendering to speech.
AXES is a list of axis names. The names, which are separated by commas, identify the column and row headers that pertain to this cell. Use AXIS when you're rendering to speech @md it will identify what position the cell occupies in the table. When it's missing, the user agent can try to find the corresponding header cells by following up columns and left along rows.
Context: <TD> is legal within
The following markup can be used within <TD>
<A>, <ABBREV>, <ACRONYM>, <ADDRESS>, <AU>, <B>, <BIG>, <BLOCKQUOTE>, <BQ>, <BR>, <CITE>, <CODE>, <DEL>, <DFN>, <DIR>, <DIV>, <DL>, <EM>, <FIG>, <FN>, <FORM>, <H1>, <H2>, <H3>, <H4>, <H5>, <H6>, <HR>, <I>, <IMG>, <INS>, <ISINDEX>, <KBD>, <LANG>, <MATH>, <MENU>, <NOTE>, <OL>, <P>, <PERSON>, <PRE>, <Q>, <S>, <SAMP>, <SMALL>, <STRONG>, <SUB>, <SUP>, <TAB>, <TABLE>, <TT>, <U>, <UL>, <VAR>
Suggested style/usage: Close Tag: OPTIONAL
<CAPTION>A nice table</CAPTION>