: The Table Data Cell element

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015 .

The HTML element defines a cell of a table that contains data and may be used as a child of the element.

Try it

Attributes

This element includes the global attributes.

Contains a non-negative integer value that indicates how many columns the data cell spans or extends. The default value is 1 . User agents dismiss values higher than 1000 as incorrect, setting to the default value ( 1 ).

Contains a list of space-separated strings, each corresponding to the id attribute of the elements that provide headings for this table cell.

Contains a non-negative integer value that indicates for how many rows the data cell spans or extends. The default value is 1 ; if its value is set to 0 , it extends until the end of the table grouping section ( , , , even if implicitly defined), that the cell belongs to. Values higher than 65534 are clipped to 65534 .

Deprecated attributes

The following attributes are deprecated and should not be used. They are documented below for reference when updating existing code and for historical interest only.

Contains a short abbreviated description of the data cell's content. Some user-agents, such as speech readers, may present this description before the content itself. Put the abbreviated content inside the cell and place the (longer) description in the title attribute, as this attribute is deprecated. Or, preferably, include the content within the data cell, and use CSS to visually clip overflowing text.

Specifies the horizontal alignment of the data cell. The possible enumerated values are left , center , right , justify , and char . When supported, the char value aligns the textual content on the character defined in the char attribute and the offset defined by the charoff attribute. Use the text-align CSS property instead, as this attribute is deprecated.

Contains a list of space-separated strings, each corresponding to the id attribute of a group of cells that the data cell applies to.

Defines the background color of the data cell. The value is an HTML color; either a 6-digit hexadecimal RGB code, prefixed by a ' # ', or a color keyword. Other CSS values are not supported. Use the background-color CSS property instead, as this attribute is deprecated.

Does nothing. It was originally intended to specify the alignment of the content to a character of the data cell. Typical values for this include a period ( . ) when attempting to align numbers or monetary values. If align is not set to char , this attribute is ignored.

Does nothing. It was originally intended to specify the number of characters to offset the data cell content from the alignment character specified by the char attribute.

Defines a recommended data cell height. Use the height CSS property instead, as this attribute is deprecated.

Specifies the vertical alignment of the data cell. The possible enumerated values are baseline , bottom , middle , and top . Use the vertical-align CSS property instead, as this attribute is deprecated.

Defines a recommended data cell width. Use the width CSS property instead, as this attribute is deprecated.