-
Notifications
You must be signed in to change notification settings - Fork 203
09. Tables
martin@mustbebuilt.co.uk edited this page Sep 1, 2024
·
1 revision
HTML tables can be made more accessible. The A11Y checklist highlights:
- Use the
tableelement to describe tabular data. - Use the
thelement for table headers (with appropriate scope attributes). - Use the
captionelement to provide a title for the table.
Check any tables for accessibility and add <th> table header element for cells that act as table headers and use the scope attribute to indicate that they are heading for the columns ie:
<tr>
<th scope="col">Qualification</th>
<th scope="col">Subject</th>
<th scope="col">Grade</th>
<th scope="col">Date</th>
</tr>You could also add a <caption> element that is placed immediately after the <table> element.