Tables can be difficult for screen readers to access, especially if they contain large amounts of data or information.
Here are some general guidelines for how to make tables accessible:
- Add a header row to the table. Header rows run horizontally across the top of the table. They list the types of data contained in the table for screen readers to know what types of information to expect.
- You can also add a column header, which runs vertically.
- Keep the table structure simple. Do not use nested tables or merged or split cells, which are less accessible options.
- Add a caption to tables that clearly describes the contents. This allows people using screen readers to decide whether they want to access the data contained in the table or move on to the next content block.
- Avoid adding blank cells to tables. This can cause some screen readers to interpret a blank space as the end of a table.
- Don't add screenshots of tables to a webpage or use in-line spacing to mimic the appearance of a table on a webpage, as a screen reader will not be able to read it.
- Don't copy and paste tables from a spreadsheet or other program into a webpage.
- If a table contains images, be sure to write alt text for each image.