CHAPTER 4 OF 5
4. Naming and organization
Your goal: name the table and organize its rows.
Add a useful caption
A caption gives this table a recognizable name. Put it directly inside table, before the row groups. A good name helps someone decide whether to explore the table.
<table> <caption>Community workshop schedule</caption> <thead> <!-- The row of column headers belongs here. --> </thead> <tbody> <!-- The workshop rows belong here. --> </tbody> </table>
Give row groups clear jobs
theadgroups the heading rows.tbodygroups the main data rows.tfootcan group footer rows, such as relevant totals. Our schedule does not need one.
The finished example
Both workshops take place at the community center. Times are local.
This reference preview includes the header relationships and caption explained across the chapters.
| Workshop | Day | Time |
|---|---|---|
| Introduction to accessible documents | Tuesday | 10:00 a.m. |
| Creating accessible tables | Thursday | 2:00 p.m. |
Does every table require a caption?
A caption is useful for this example, but it is not automatically required in every situation to meet WCAG. Evaluate whether the table's purpose and relationships are sufficiently clear. More complicated tables may also need an explanation of their organization.