When to use tables and how to make them accessible.
When to use tables
Tables can easily become problematic for accessibility reasons. For that reason tables should only be used to present data.
Do not use tables for cosmetic changes to layout, for example to present a list because you think it looks better that way.
If you do use tables, make sure they have the structural markup to make them accessible. To develop accessible websites, it is best to simplify tables as much as possible to minimize the cognitive load they require to understand.
Alternatives to tables
A simple table can often be replaced with a:
- series of bulleted lists with headings and subheadings
- single bulleted list, using commas to separate the information
How tables are used
There are two basic uses for tables on the web: data tables and layout tables. The original intended use of HTML tables was for tabular data, where data is organized with logical relationships in grids.
Try not to use layout tables for visual presentation. Layout tables do not have logical headers that can be mapped to information within the table cells. Instead use CSS for visual presentation.