Treat entity label as a row-level header in entity list tables

Created on 20 April 2018, over 6 years ago
Updated 30 May 2023, over 1 year ago

Problem/Motivation

Drupal core uses lots of tables to list entities. These tables have their column headers correctly identified, but not at the row level.

For assistive technology, such as screen readers or speech control, it often helps to have a row-level header specified too. For example, screen readers provides tools for users to get more information about their position in the table, on demand. They can announce the cell coordinates, or the column and row headers. The more columns a table has, the more useful row-level headers are.

In the absence of explicit row-level table headers, some screen readers treat the first <td> in the row as a header. Unfortunately this is often a checkbox or a drag handle, which isn't the best column to use. We can make the experience more robust for assistive tech if we specify which column should be treated as the row-level header. In most cases, the entity label will be best.

Proposed resolution

For entity listing tables, treat the entity label as a row level table header (i.e. <th scope="row">). The pattern is described at Table with an offset column of header cells.

Remaining tasks

  • Patch for EntityListBuilder
  • Manual accessibility testing.
  • Tests

User interface changes

  • Improves HTML semantics, principally for the benefit of assistive technology.
  • CLARIFY: we might have some styling for row-level table headers, though this isn't strictly required for the assitive technology benefit.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

11.0 🔥

Component
Entity 

Last updated about 11 hours ago

Created by

🇬🇧United Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024