Use tables only for tabular content.
Do not use tables for a visual layout of content.
Always try to add a table caption (<caption>
) to the tables. A caption always helps the user to understand what the table is about.
Note that a table caption is not the same as the headings on the page (H2-H6). The table caption is read in the context of the table, the page headings are not.
Every table should have a header row or column. Otherwise, the table content will not be understandable to assistive technologies.
If you are building a table that you don't think needs headers, stop to think about whether a table is the right way to convey that information.
If a table has a lot of merged cells, the table is likely to be unnecessarily complex. The combination of cells may not be communicated to assistive technologies in a way that is understandable enough.
Consider whether a complex table can be split into several more easily understood tables.
Also, consider how the table works on a mobile device. Sometimes a table that is larger on a desktop screen is much easier to understand than when viewed on a mobile device. This is also affected by the technical implementation of the table. A responsive table usually behaves differently from a scrollable table.