Picto thématique

Rule n° 236 - Cells in data tables are linked to their headers

Some Internet users vocalise web content using technical aids. A very clear picture on the screen can become totally incomprehensible in voice mode. However, it is quite easy to foresee this case.

#Accessibility #Development #Editorial #Structure and code

Goal

  • Allow technical aids to return the information contained in data tables in a comprehensible way, by informing users of the logical relationships between the table’s content and headers.

Implementation

Use the HTML th element and its scope attribute to tag header cells and explain their scope (scope of col value for a column header, of row value for a row header).

For headers that only apply to part of a row or column, check systematically for the idattribute, for the th element and the headers attribute for the td elements with the appropriate values:

  • Give each header (th element) an id attribute id attribute (for example, id="foo);
  • Use the headers attribute in each cell (td element) to indicate the associated headers (for example, headers="foo" for each cell attached to the header having the attribute id="foo").
  • _ x000D__

To find out more:

Control

In the generated code of data tables:

  • Check the systematic use of the th element to tag row or column headers;
  • For headers applying to the whole of a row or a column, check that the scope attribute with the appropriate value (row for a row or col for a column) is systematically included;
  • For headers which only apply to part of a row or column, check that the idattribute for the th element and of the headers attribute for thetd elements are systematically included with the appropriate values:
  • Each header (th) element must have an id attribute (for example, id="foo");
  • The headers attribute must be used in each cell (tdelement) to indicate the associated headers (for example, headers="foo"for each cell attached to the header having the id="foo" attribute).

By Opquast - Read the license


Discover Opquast training and certification

The objective of these rules and the Opquast community mission is ‘making the web better’ for your customers and for everyone! Opquast rules cover the key major areas of risk that can negatively affect website users such as privacy, ecodesign, accessibility and security.

Opquast training has already allowed over 19,000 web professionals to have their skills certified. Train your teams, contact us

We offer a 1 hour free discovery module.