Table headers
Silktide checks that tables presenting data define header cells. Headers tell people using what each row and column means, something sighted readers infer from the table's layout.
Consider a table of surnames and cities. Without a header row, a value like "Washington" could be either - the meaning only becomes clear when the columns are labeled.
<!-- Problem: headings are ordinary cells, so they carry no meaning -->
<table>
<tr>
<td>Surname</td>
<td>City</td>
</tr>
<tr>
<td>Washington</td>
<td>London</td>
</tr>
</table>
Why this matters
A moves through a table one cell at a time. When headings are defined, it can announce the relevant heading alongside each value, so "London" is read as "City: London". Without headings, the listener hears a bare stream of values and has to memorize the table's layout to make sense of them - and for larger tables that is practically impossible.
Making the top row bold or a different colour is not enough. Visual styling carries no meaning for assistive technology; only the underlying does.
How to fix it
- Change each heading cell from
<td>to<th>, and add ascopeattribute saying whether it heads a column or a row:
<!-- Fixed: headings are real header cells -->
<table>
<tr>
<th scope="col">Surname</th>
<th scope="col">City</th>
</tr>
<tr>
<td>Washington</td>
<td>London</td>
</tr>
</table>
- If the table doesn't present data at all and is only used to arrange the
page visually, add
role="presentation"to the<table>element so assistive technology ignores its structure. Better still, replace layout tables with CSS - they are strongly discouraged in modern web design.
How Silktide tests this
- Find every table on each page.
- Skip tables marked as presentational with
role="presentation". - Skip tables with only one row or only one column, which are unlikely to be data tables.
- Report each remaining table that contains no
<th>header cell at all.
Troubleshooting
My table has headings, but they are styled <td> cells
Cells that only look like headings do not count. Assistive technology cannot
see fonts or colours; convert the cells to <th>.
My layout table is flagged
Silktide only skips layout tables that declare role="presentation". If a
table is genuinely presentational, add that attribute - or replace the table
with CSS layout.