View video tutorial

HTML <td> Tag

HTML

The <td> tag defines table data.

HTML <td> Tag


An HTML table contains two types of cells. Header cells defined by <th> element and Data cells defined by <td> element.

The top heading row represents the header that contain cells <th> for the table column name.

The <td> element represents a cell in a table that contains data.

Element Attributes

Attribute Value Description
colspan number This specifies how many columns the cell extends.
headers header_id This attribute contains a list of strings corresponding to the id attribute of the th elements.
rowspan number This specifies how many rows the cell extends.

Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<tr>
    <td>Lex</td>
    <td>De Haan</td>
    <td>AD_VP</td>
    <td>17000</td>
</tr>
<tr>
    <td>Bruce</td>
    <td>Ernst</td>
    <td>IT_PROG</td>
    <td>6000</td>
</tr>
Try it Now »

Click on the "Try it Now" button to see how it works.