Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _rules/table-headers-attribute-refer-to-data-cells-a25f45.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Each target's [attribute value][] is a [set of space separated tokens][], and no

### Accessibility Support

There are no accessibility support issues known.
Different screen reader and browser combinations may fail to correctly associate table headers and cells when using the headers and id attributes.
While these constructs are technically valid, relying solely on them can still lead to accessibility issues depending on the user’s setup.

### Bibliography

Expand Down Expand Up @@ -112,6 +113,7 @@ The `headers` attribute on the cell refers to a `th` element within the same `ta
#### Passed Example 3

The `headers` attribute on the data cells in the second row refers to a `td` element with a role of `columnheader` within the same `table`.
Although this construct does not conform to the [ARIA in HTML](https://www.w3.org/TR/html-aria/#el-td) or [HTML specifications](https://html.spec.whatwg.org/#attributes-common-to-td-and-th-elements), it behaves the same as using a `th` element instead of a `td` element with a role of `columnheader`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Although this construct does not conform to the [ARIA in HTML](https://www.w3.org/TR/html-aria/#el-td) or [HTML specifications](https://html.spec.whatwg.org/#attributes-common-to-td-and-th-elements), it behaves the same as using a `th` element instead of a `td` element with a role of `columnheader`.
Although this construct does not conform to the [ARIA in HTML](https://www.w3.org/TR/html-aria/#el-td) or [HTML specifications](https://html.spec.whatwg.org/#attributes-common-to-td-and-th-elements), it behaves the same as using a `th` element instead of a `td` element with a role of `columnheader`, on all popular browser / screen reader combinations, at the time of writing.

^^ because I think it would be valuable to note somehow that this is a snapshot in time, based on some (great!) testing that you did, and the behaviour could change. It's like an "Accessibility Support Note" for this example.

Also I wonder if it's worth linking to your test table. That would help future archeologists. And maybe even spell out the fact that your statement above ("it behaves the same...") was derived from the observation that in your test table, the "Table 1" column is equal to the "Table 5" column.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion committed. I'm not sure whether we can link directly to a specific GitHub issue. @carlosapaduarte, do you know if that is possible? If not, perhaps we could add a code comment referencing the issue, at least for internal tracking.


```html
<table>
Expand Down