Skip to content

Table Example: Remove rowgroup wrappers from the table - #3492

Open
jsabutis wants to merge 1 commit into
w3c:mainfrom
jsabutis:fix/3232-table-rowgroup
Open

jsabutis wants to merge 1 commit into
w3c:mainfrom
jsabutis:fix/3232-table-rowgroup

Conversation

@jsabutis

Copy link
Copy Markdown

What

Removes the two <div role="rowgroup"> wrappers from the table example, as agreed in the 2025-02-25 APG meeting: they serve no purpose in the example and only add code that people copy.

  • table.html: the header row and the body rows are now direct children of the table element. The rowgroup row is removed from the Role, Property, State, and Tabindex Attributes table.
  • table.css: the zebra stripe selector depended on the last rowgroup, so it now uses :nth-child(even of [role="row"]). The same rows (Fred and Ralph) are shaded as before.
  • test/tests/table_table.js: removes the rowgroup-role test, and the row, columnheader and cell tests no longer require a rowgroup ancestor.

The pattern page still mentions rowgroup as an allowed container, since it is still valid ARIA. Only the example changes.

How tested

  • npm run regression -- test/tests/table_table.js (Firefox via geckodriver): 6 of 6 pass.
  • npm run lint (eslint, prettier, stylelint, htmlhint, vnu, cspell): clean.
  • Chrome: the accessibility tree is now table, rows, cells with no rowgroup level, and the computed row backgrounds match main exactly.

Closes #3232

The rowgroup divs serve no purpose in the example and add code that
gets copied. Rows are now direct children of the table, the rowgroup
row is removed from the attributes table, the zebra stripe selector no
longer depends on a rowgroup, and the rowgroup regression test is
removed.

Closes w3c#3232

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use rowgroup role for table body

1 participant