Table Headers
Headers explain what a data cell means. A reader encountering “8” should be able to discover that it refers to the Bike repair session’s available places.
How it works
- Use th for labels that identify rows or columns, not merely for any cell you want bold.
- scope="col" associates a header with its column; scope="row" associates it with its row. A caption identifies the table as a whole.
- For complex multi-level tables, explicit headers and id relationships may be needed. Simplifying the table is often a better first decision.
A practical example
<table>
<caption>Available places by day</caption>
<tr><th scope="col">Session</th><th scope="col">Saturday</th></tr>
<tr><th scope="row">Bike repair</th><td>8</td></tr>
</table>
The data cell is described by both the session row header and the Saturday column header. Styling does not have to carry this information alone.