Accessibility Wiki

A data table should have an accessible name

Rule data-table-caption · Component patterns (best practice) · impact moderate · Static + live

↩ Back to the rules index · WCAG cross-reference

Why it matters

A caption (or equivalent accessible name) gives a data table a heading that screen-reader users hear when they enter it and can use to find it in the table list. Layout tables (no header cells, or role="presentation"/"none") are excluded — only tables that convey tabular data are checked.

How to fix

Add a as the first child of the table describing its content, or give the table an aria-label / aria-labelledby.

Example

✕ Fails
<table><tr><th>Name</th></tr><tr><td>Ada</td></tr></table>
✓ Passes
<table><caption>Users</caption><tr><th>Name</th></tr><tr><td>Ada</td></tr></table>

WCAG success criteria

1.3.1 Info and Relationships — Level A

Structure and relationships conveyed visually (headings, lists, tables, labels, groups) must also be available programmatically.

Understanding 1.3.1

Standards

This rule contributes to the following standards:

WCAG A EN 301 549

Standard Criteria
EN 301 549 9.1.3.1

References