WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: PDF Table column headers and scope attribute

for

From: Duff Johnson
Date: Mar 21, 2023 9:44AM


> Duff, you’ve got me curious now. How will PDF/UA 2 approach these issues? Do you mean table related requirements in particular or standards-AT relationships in general ?

It's not a simple story.

In essence, PDF 2.0, on which PDF/UA-2 is based, changed some definitions in ISO 32000, the “core” PDF specification. PDF/UA then leverages the updated language in PDF 2.0…

For now, until there's a more succinct overview, it's probably simplest to quote from them both (may ISO forgive me…):

ISO 32000-2, 14.8.4.8.3:

If the Headers attribute (see 14.8.5, "Standard structure attributes") is not specified, any cell in a table may have multiple headers associated with it. These headers are defined either explicitly by the Headers attribute, or implicitly, by the following algorithm:

To find headers for any data or header cell, begin from the current cell position and use the current value of WritingMode to search towards the first cell in the appropriate horizontal/vertical direction. The search terminates when any of these conditions is reached:

the edge of the table is reached
a data cell is found after a header cell
a header cell has the Headers attribute set — the headers that are specified are appended to the row/ column list that is being built

When a header cell is found in the search and the (implicit or explicit) Scope attribute of the header cell is either Both or Row/Column, the header cell is appended to the end of the list of row/column headers, resulting in a list of headers ordered from most specific to most general.

NOTE This algorithm works for languages with different intrinsic directionality of the script (such as right-to-left) because the structure always reflects the logical content order of the table.

To the above, PDF/UA-2 will add, in 8.3.4.26:

Tables shall be regular.

NOTE 1 Tables are regular when the number of logical cells is equal in each row after accounting for RowSpan and ColSpan attributes.

Row groupings formed by THead, TBody and TFoot structure elements shall be regular.

NOTE 2 Row groups are regular when the number of logical cells is equal in each row after accounting for RowSpan and ColSpan attributes and where cells do not span row groups.

When a table contains header cells, that table shall provide sufficient semantic information to allow accurate determination of which of its table header cells (structure element TH) pertain to other cells (see ISO 32000-2, 14.8.5.7).

ISO 32000-2, 14.8.4.8.3 describes an algorithm to determine header cells for a cell in the table. If the algorithim results in default values for Scope (see ISO 32000-2, Table 384) that are insufficient to describe the relationship between the header cell and other cells, then the Scope attribute shall be specified.

If the algorithim results in a header cell with an implicit or explicit Scope that cannot describe the header/cell relationships for all of the cells in the table, then the Headers attribute shall be present for all cells to which a header applies (see B.4).

NOTE 3 This means that once the Headers attribute is used it is required for all cells that have headers in the table regardless of whether Scope describes their relationships.

As noted in ISO 32000-2, Annex L, Table rows (TR) may include both TH and TD cells.

NOTE 4 The use of Headers does not negate the need for Scope.

Examples of table-specific attributes are provided in Annex B.4.

NOTE 5 End user reliance on assistive technology implies a need for as much information as possible about the structure of tables. Table header cells play a key role in providing structural information.

NOTE 6 Tables can contain column header cells, row header cells, both, or none.

Duff.