When table headers are properly associated with the data they describe, assistive technologies like screen readers can accurately present the table's structure and content to all users, including those with visual impairments. This helps users understand the relationships between the data points, which makes the information more accessible and easier to navigate.
Without this connection, the content in a table can become confusing or meaningless for those who rely on such technologies, which leads to a poor user experience.
Bridgit is a blind mother to a five-year-old girl and an 11-year-old boy:
“You know, my little girl, she is only five, and we had to take her in for a blood test. The doctors were worried she might have diabetes, just like my dad did. I was really anxious about it, of course, as any mom would be.
So, when the results came in, I had to check them myself using my computer. Now, with my screen reader, it is always a bit tricky. The results were all in this table format, and let me tell you, it was not easy to make sense of it. The screen reader just starts reading everything out of order. So instead of getting a clear table reading, I’m hearing things like "glucose level, 102," then right after, 140, cholesterol, then something like "A1C, 5.6" followed by 150, and 6.2 without any clear connection between what these numbers mean in relation to each other.
It is like trying to sort through a jumble of information that just does not fit together. I had to go over it several times, piecing things together, and even then, I was not sure if I was understanding it all correctly. It is frustrating because, as a mom, you want to know what’s going on with your child right away, but sometimes, technology just does not make it easy. Eventually, I had to call the doctor’s office to get them to explain the results to me directly, just to make sure I was not missing anything important.”
Example: Table without correctly associated headers¶
This <th> element with id equal to “col2” does not have an assigned cell within the same table element because the headers attribute removes the cell association from its column.
<table>
<tr>
<th id="col1">Country</th>
<th id="col2">Starting with a Z</th>
</tr>
<tr>
<td>Zambia</td>
<td headers="col1">Zimbabwe</td>
</tr>
</table>
The Optimize platform highlights cases where table headers are not linked to any data cells. Table headers can be HTML <th> elements or other elements with an ARIA role of columnheader or rowheader. To fix the issue, adjust your HTML code to create a relationship between the header cell that triggered the error and the cell it is meant to describe.
This relationship between header cells and other cells can be made either implicitly through the table’s structure or explicitly using the headers attribute.
See the ACT rules section below, which provides a link to a full technical explanation of this check and offers detailed examples on how to pass it.