WebAIR

In each table, do you make it clear which data cells are associated with which header cells? (TAB05)

Why is this important?

Data tables can be difficult to interpret, particularly when they are complex or when there are multiple sets of headings. By associating data cells with the appropriate heading and column/row information, screen readers are able to inform the user of this information for any given cell of the table.

How to fix the problem

Use of the appropriate markup can help to distinguish data cells <td> from headings <th>. A step further is to use the scope attribute to associate a heading with a particular row, column, or group of rows or columns.

Example

//An example of the scope attribute used to associate a particular heading with a particular column.
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">Monday</th>
<th scope="col">Tuesday</th>
<th scope="col">Wednesday</th>
<th scope="col">Thursday</th>
<th scope="col">Friday</th>
<th scope="col">Saturday</th>
<th scope="col">Sunday</th>
</tr>
<tr>
<th scope="row">Gold Tier</th>
<td>£30.00</td>
<td>£30.00</td>
<td>£30.00</td>
<td>£45.00</td>
<td>£60.00</td>
<td>£60.00</td>
<td>£45.00</td>
</tr>

Further Information

  1. http://www.w3.org/community/webed/wiki/HTML_tables#The_most_basic_table
  2. http://docs.webplatform.org/wiki/guides/html_tables
  3. http://webaim.org/techniques/tables/data#id