Skip to content
easeweb
Search topics

Data tables with headers that are only bold text

The header row is styled to look like headers, but every cell is a td, so nothing ties a value to its row or column.

WCAG 2.2
SC 1.3.1A
Required by
Section 508 · EN 301 549 (EU)
Broken <td>
The accessibility problem illustrated: No vision:Thirty what?
01

The problem

Screen reader users hear numbers without knowing which row or column they belong to

02

Try it

Press Tab to move through the prices

Each Tab stands in for a screen reader moving to the next cell. The panel shows what it announces. Can you tell what each price is for?

Broken Can you fix this?

BrokenHeader cells drawn with td and bold text
PlanMonthlyYearly
Starter$12$120
Team$30$300

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark header cells as headers, and say which way each reads

Before
BrokenHeader cells drawn with td and bold text
<table class="prices">  <tr class="head">    <td>Plan</td>    <td>Monthly</td>    <td>Yearly</td>  </tr>  <tr>    <td class="plan">Starter</td>    <td>$12</td>    <td>$120</td>  </tr>  <tr>    <td class="plan">Team</td>    <td>$30</td>    <td>$300</td>  </tr></table>
What is wrong3 points
  • A screen reader announces "$30" alone, with neither its plan nor whether it is monthly or yearly.
  • The headers are headers only to the eye: the head and plan classes only make the text bold.
  • Nothing says which header applies to which cell. Every cell is a td, so every cell is data.
After

Th with scope

<table class="prices">  <thead>    <tr>      <th scope="col">Plan</th>      <th scope="col">Monthly</th>      <th scope="col">Yearly</th>    </tr>  </thead>  <tbody>    <tr>      <th scope="row">Starter</th>      <td>$12</td>      <td>$120</td>    </tr>    <tr>      <th scope="row">Team</th>      <td>$30</td>      <td>$300</td>    </tr>  </tbody></table>
How it is fixed3 steps
  1. Make each header a th, with the header row in a thead and the rest in a tbody.
  2. Give each th a scope that says whether it heads its column or its row. A screen reader now announces "Team, Monthly, $30" on that cell, and when the person moves down a column it repeats only the row header that changed.
  3. Remove the head and plan classes: th is bold by default.

This fixes the Before and passes 1.3.1. Of the extras the ARIA roles are kept for below, a real table takes sortable columns, with the button and aria-sort on its th, and aria-rowcount too.

Why this fix: Use native HTML first

04

Verify the fix

5 checks, no mouse.

Test with: Screen reader, Keyboard, Zoom

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the table component changes.

Limits

This is a starting pattern, not a guarantee for every table. Screen readers differ in how much header text they repeat and when. Tables with headers several levels deep can be hard to follow even with perfect markup; where the data allows, split them into simpler tables. A table whose cells people change is a different widget, covered in editable data grids a keyboard can't move through or edit. Headers only give a cell its context: a cell that shows its value as an icon also needs the value in words, as in comparison tables with ticks and crosses that read as blank.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service