XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / td

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

td

HTML 4.01 | HTML 5

<td> ... </td>

Defines a table cell. A cell can contain any content, including other tables.

Start/end tag

HTML: required/optional; XHTML: required/required

Attributes

Core, internationalization, events, global HTML 5 attributes

  • abbr="Text"

    Not available in HTML 5. Contains a short version of the cell’s content.

  • align="left|right|center|justify|char"

    Not available in HTML 5. Defines horizontal text alignment within the cells. The default is left.

  • axis="Text"

    Not available in HTML 5. Marks the cell as belonging to a category, which can be used to organize or search the table in different ways.

  • background="URL"

    Not standards-compliant. Defines a background image for the cell, optionally tiled. Stylesheets should be used for this purpose.

  • bgcolor="#rrggbb" oder "Farbname"

    Deprecated. Not in HTML. Defines a background color for the cell. A color explicitly set on the cell takes precedence over column or table colors. Stylesheets are preferable here too.

  • char="Zeichen"

    Not available in HTML 5. Defines the character on which cell content aligns when the attribute align has the value char. The default is a decimal comma, depending on the language. This attribute is rarely supported.

  • charoff="Länge"

    Not available in HTML 5. Defines the offset to the first alignment character in a row. If no alignment character is used, the row should shift horizontally to end at the alignment position. This attribute is rarely supported.

  • colspan="Zahl"

    Specifies how many columns the cell should span. The default is 1. According to HTML 4.01, the value 0 (zero) means that the cell spans all columns from the current one through the table’s last column.

  • headers="ID-Referenz"

    Contains a list of all header cells with information about this data cell. This is intended to improve table accessibility for nonvisual browsers.

  • height="Pixel" oder "Prozentwert"

    Deprecated. Not in HTML 5. Defines the cell’s height in pixels or as a percentage of the table height. The height in the first column applies to the other cells in the row. All cell heights in a row must agree. Pixel values are more reliable than percentages, which work only if the table height is specified in pixels.

  • nowrap (nowrap="nowrap" in XHTML)

    Deprecated. Not in HTML 5. Disables automatic line wrapping in the cell. Breaks must be inserted explicitly with br elements or by starting a new paragraph.

  • rowspan="Zahl"

    Specifies how many rows the cell should span. The default is 1. According to HTML 4.01, the value 0 (zero) means that the cell should span from the current column to the table’s last column. However, browsers rarely support this feature.

  • scope="row|col|rowgroup|colgroup"

    Not in HTML 5 for td. Specifies the table cells for which this cell provides header information. The value col refers to all cells below it. colgroup represents the column containing the cell itself. The value row marks this cell as the header for all subsequent cells in the same column. The value rowgroup means that this cell is the header for its row. This is intended to make tables more accessible to nonvisual browsers. In HTML 5, scope applies only to the element th.

  • valign="top|middle|bottom|baseline"

    Not available in HTML 5. Sets vertical text alignment for the cells of a column.

  • width="Pixel" oder "Prozentwert"

    Deprecated. Not in HTML 5. Defines the cell’s width in pixels or as a percentage of the table width. The width in the first row applies to subsequent cells in the column. Values must not differ between cells in a column.

Example

<table>
  <tr>
    <td colspan="2">Zelle 1</td>
  </tr>
  <tr>
    <td>Zelle 3</td><td>Zelle 4</td>
  </tr>
</table>

 

> back to the alphabetical list of elements

   

 

 

 

back to top