Skip to content

Layout: table header semantics — THead/TBody/TFoot, Scope, Headers and regularity #296

Open

Description

@Tim81

Row.IsHeader marks a row as a header, and TableRenderer.cs:344,348,371 uses it to emit TH rather
than TD and to find header row indices. That is the whole of the table header model.

Missing: THead, TBody and TFoot grouping; the Scope attribute; the Headers attribute; and any
check that the table is regular.

What §8.2.5.26 requires

Tables shall be regular.

— equal logical cell count in every row once RowSpan and ColSpan are accounted for. And:

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

with cells not spanning across row groups.

For header association (14.8.5.7):

  • If the default Scope inference is insufficient, Scope shall be specified.
  • If a header cell's scope cannot describe the relationships for all cells it applies to, Headers
    shall be present for all cells to which a header applies
    . NOTE 4 is emphatic: once Headers is
    used anywhere in a table it is required for every cell in that table that has headers. NOTE 5
    adds that using Headers does not remove the need for Scope.

That all-or-nothing rule is the one worth encoding carefully, because partial Headers usage is the
natural thing to write and is non-conforming.

Scope

  • THead/TBody/TFoot grouping, with header rows repeating on each page — worth confirming the
    existing repeat behaviour survives the grouping change.
  • Scope on header cells, with sensible inference and an explicit override.
  • Headers on data cells, with the all-or-nothing rule enforced rather than left to the caller.
  • A regularity check that fails loudly at build time (through L19's diagnostics) rather than
    producing a non-conforming document quietly.

Acceptance

  • An irregular table is reported at build time.
  • A table with a two-level header producing correct Headers on every data cell.
  • Row groups regular, cells not spanning them.
  • Header rows repeating across a page break with the grouping intact.
  • veraPDF ua2 green on a complex table.

Relates to


Plan labels used above, resolved: L0c #287 · L19 #304 · L40 #309.

Activity

  1. added
    area/layout
    type/feature
    on Aug 29, 2026
  2. Tim81 commented on Nov 18, 2026

    @Tim81
    OwnerAuthor

    Handbook acceptance from the research, minor for a handbook of simple column-header tables but included in v2.4.

    Current behaviour: TH only through Row.IsHeader (Row.cs:49), always /Scope /Column
    (TableRenderer.cs:499-504: row.IsHeader ? "TH" : "TD", TableHeaderScope = "Column"). Cell has no header flag
    (its public members, Cell.cs: Content, ColSpan, RowSpan, Style, Padding, Background, Alignment,
    Language). The research measured correct TH with /Scope /Column and correct span attributes (veraPDF 7.2-41,
    -42, -43 passed).

    Acceptance to add: a Cell.IsHeader (or a Scope) for row headers; Headers/ID association; THead and
    TBody, with the header rows held once (#582 draws the repeated copies on continuation pages as artifacts);
    #489 (row widths when a span covers a whole row) in the same change.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/layouttype/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions