"id" and "headers" or "scope" for data table availability?

Which method is most supported by screen readers - id and headers or scope attributes?

I find conflicting information about how one of these methods is supported in binding HTML table headers to table cells.

+5
source share
1 answer

It depends on the complexity of your data table. Using scope is usually the best choice.

If you use colspan or rowspan , for example, using id and headers would be a better choice.

H43: using id attributes and headers to associate data cells with header cells in data tables:

This method is used when data cells are associated with more than one row and / or one column heading. This allows screen readers to say the headers associated with each data cell when relationships are too complex to identify using only one element or th element with a scope attribute.

Moreover, when the data table needs such additional attributes, it may be difficult for other people (not using screen readers) to associate the cell with their headings, and it may be necessary to have additional visual signals for the headings (for example, alternating colors, effects mice, etc.).

+3
source

Source: https://habr.com/ru/post/1235586/


All Articles