Skip to content
Performance & Accessibility

Accessible Data Tables: What Actually Works

Marking up tabular data so its structure is available to people who cannot see the visual grid.

Marcus Adeyemi Technical Director 2 min read 23 views
Accessible Data Tables: What Actually Works

Why does it matter?

A table without proper headers is a list of disconnected values to a screen reader user, whatever it looks like visually.

What are the numbers?

  • Headers th elements, with scope where the structure needs it
  • Caption describes the table's purpose
  • Complex tables may need headers and id associations
  • Layout tables should not be used; CSS handles layout
  • Responsive tables must retain their semantics when restructured

What should I do?

  1. Use th for header cells and set scope appropriately
  2. Give every table a caption
  3. Keep the markup semantic when making tables responsive
  4. Avoid merged cells where a simpler structure would work
  5. Test tables with a screen reader
What to do and what to avoid with accessible data tables, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Tables built from divs
  • Header cells marked up as ordinary cells
  • Responsive patterns that discard table semantics
  • Tables used for page layout

When should I get help?

Short answer Bring in help when complex tables must be made accessible, when responsive behavior breaks semantics, or when data interfaces must meet conformance.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Performance & Accessibility work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Performance & Accessibility