Skip to main content

The <td> Element

As defined in the HTML Living Standard, the <td> element represents a data cell in a table. It is used to contain any type of flow content—text, images, links, or even other tables—that makes up the primary information of a dataset.

Visual Example:

User ID Status
SA-001 Active
SA-002 Pending

(The highlighted cell above is a <td> element.)

<tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> View HTML Living Standard: The td element

Technical Attributes

WCAG Requirement: Info and Relationships

Success Criterion 1.3.1 (Level A): Information, structure, and relationships conveyed through presentation can be programmatically determined.

For simple tables, browsers automatically link a <td> to the <th> elements in its row or column. However, for complex tables with nested headers or multi-level relationships, the automatic association often fails. In these cases, you must use the headers attribute on the <td> to explicitly link the data to its corresponding categories. This ensures screen reader users hear the correct context as they move from cell to cell.

Understand SC 1.3.1: Info and Relationships

Best Practices

A11y Tip: Responsive Stacking

In mobile views where tables "stack" (turning rows into cards), use the data-label attribute on the <td> and CSS generated content (::before) to replicate the header labels visually. This ensures the Info and Relationship remains perceivable even when the grid structure is removed.