Data table checker

Checks that data tables mark header cells, connect cells to their headers and have a caption or name.

What this check looks for

The audit runs this check with every other check, on the page as the browser renders it.

Tables without header cells
Data tables built only from td cells, so screen readers can't announce column names.
Headers without scope
Header cells in complex tables that don't say whether they label a row or a column.
Empty header cells
th elements with no text.
Layout tables with data markup
Tables used for layout that carry headers or captions and confuse screen readers.

What a failure looks like

An opening hours table uses plain cells for the day names, so a screen reader reads "9:00" without saying which day.

HTML
<!-- Broken: no header cells -->
<table>
  <tr><td>Day</td><td>Opens</td></tr>
  <tr><td>Monday</td><td>9:00</td></tr>
</table>
HTML
<!-- Fixed: a caption and header cells with scope -->
<table>
  <caption>Opening hours</caption>
  <tr><th scope="col">Day</th><th scope="col">Opens</th></tr>
  <tr><th scope="row">Monday</th><td>9:00</td></tr>
</table>

How it shows in AccessGuard

Each finding names the WCAG criterion, explains the problem in plain words and shows the element that fails, so a developer can find it on the page.

A data tables finding in AccessGuard with its severity, WCAG criterion, description and the affected HTML element

WCAG criteria

Findings from this check name one of these criteria. How much of each the audit can decide on its own:

WCAG criteria covered by the data tables check
Criterion Level Automation
1.3.1 Info and Relationships Headings, lists, tables, labels and landmarks in the markup are checked. Structure shown only visually needs a person. A Partly automated

What still needs a person

No automated tool can confirm these. AccessGuard marks related findings as Review, so nobody mistakes them for a pass.

  • Whether a table is a data table or only used for layout.
  • Complex tables with merged cells, which may need headers and id attributes.

Questions

When do I need scope on header cells?

Simple tables with one header row work without it. Add scope="col" and scope="row" whenever a table has both row and column headers.

Should layout use tables?

No. Use CSS grid or flexbox. If an old layout table can't be replaced yet, add role="presentation" and don't use th or caption in it.

Is a caption required?

WCAG doesn't require one, but a caption or an aria-label tells screen reader users what the table is before they enter it.

Check a client page for data tables issues

The free audit runs this check and every other one. Results in about a minute.