Caption data tables so their purpose is clear
A caption element, placed first inside a table, gives that table a title assistive technology can find and announce. W3C lists H39 as sufficient for 1.3.1 Info and Relationships, in the sense of taking a relationship the layout already shows and making it available to software too. The test is narrower than people expect. It runs where a visible title already sits above the table and needs binding to it, rather than demanding a caption on every table ever written. There is one place a caption is actively wrong. A table used purely for layout is meant to be invisible to a reader, and a caption breaks that transparency and creates a separate failure. WCAG does not ban layout tables. It does mean a layout table gets no caption, no th and no summary.
How we find it in an audit
A scanner lists tables with no caption, which is a starting point rather than a finding, because a missing caption only matters when nothing else names the table. So we read what sits around it. Then we flag the captions that say nothing, because Table 4 is a caption and it is not a title.
How affected users experience it
Screen reader users often ask for a list of the tables on a page and jump straight to the one they want. With captions, that list reads Quarterly revenue by region, then Shipping rates by weight, and the choice takes a second. Without them it reads table with six columns and 40 rows, twice over, and the only way to tell them apart is to start reading cells.
Passes vs. fails
Passes
<table>
<caption>Quarterly revenue by region</caption>
<tr><th scope="col">Region</th><th scope="col">Q1</th></tr>
<tr><td>North</td><td>412,000</td></tr>
</table>Fails
<table>
<tr><th>Region</th><th>Q1</th></tr>
<tr><td>North</td><td>412,000</td></tr>
</table>How this gets tested
The W3C publishes test rules that define what a checker looks for here.
- ARIA attribute is defined in WAI-ARIAA tool can check this
- ARIA state or property has valid valueA tool can check this
- Element with role attribute has required states and propertiesA tool can check this
- Form field has non-empty accessible nameA tool can check this
- Headers attribute specified on a cell refers to cells in the same table elementA tool can check this
- Role attribute has valid valueA tool can check this
- ARIA global properties not used where prohibitedA tool can check this
- ARIA required context roleA tool can check this
- ARIA required owned elementsA tool can check this
- ARIA state or property is permittedA tool can check this
- Table header cell has assigned cellsA tool can check this
Other ways to satisfy this rule
52 guides on this site are filed under 1.3.1 Info and Relationships. W3C lists this one as sufficient for that rule when used for making information and relationships conveyed through presentation programmatically determinable, so the condition is part of the test rather than a footnote to it.
- ARIA11sufficientAdd landmarks so users can skip around
- ARIA12sufficientUse role=heading when h1-h6 is impossible
- ARIA13sufficientName repeated landmarks so they are distinguishable
- ARIA16sufficientName controls from visible text with aria-labelledby
- ARIA17sufficientGroup related form fields with ARIA roles
- ARIA20sufficientMark leftover page areas with role=region
This guide is our interpretation of W3C technique H39: Using caption elements to associate data table captions with data tables. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.