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.).
source share