Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'scope' attribute to <th> tags #2021

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

McLaynV
Copy link
Contributor

@McLaynV McLaynV commented Nov 10, 2024

The following changes are implemented

Add a 'scope' attribute to tags.

Changes in the user interface:

Better support for screen readers. This increases the accessibility of tables to visually impaired users.

Checklist when submitting a final (!draft) PR

  • Commits are tidied up, squashed if needed and follow guidelines in CONTRIBUTING.md
  • Code builds
  • All existing tests pass
  • All new critical code is covered by tests
  • PR is linked to the relevant issue(s)
  • Rebased with the target branch

Reasoning

Associating <table> headers, i.e. <th> elements, with their <td> cells enables screen readers to announce the header prior to the data. This considerably increases the accessibility of tables to visually impaired users.

There are two ways of doing it:

  • Adding a scope attribute to <th> headers.
  • Adding an id attribute to <th> headers and a headers attribute to every <td> element.

It is recommended to add scope attributes to <th> headers whenever possible. Use <th id="..."> and <td headers="..."> only when <th scope="..."> is not capable of associating cells to their headers. This happens for very complex tables which have headers splitting the data in multiple subtables. See W3C WAI Web Accessibility Tutorials for more information.

@Fajfa
Copy link
Member

Fajfa commented Nov 18, 2024

Sounds reasonable, will check/merge

@Fajfa Fajfa self-assigned this Nov 18, 2024
@Fajfa Fajfa merged commit cba831a into cortezaproject:2024.9.x Nov 18, 2024
11 of 12 checks passed
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.

2 participants