Documentation
¶
Overview ¶
Command tableaudit reports tables whose header cells cannot be associated with their data.
A screen reader announces a data cell together with its headers, and it can only do that if the association is discoverable: a scope attribute on each <th>, or a headers attribute on each data cell naming the ids of its headers, or a table simple enough that the implicit algorithm works - one header row or column, no spans, no nesting.
The reason this is a good fit for a streaming rewriter, where the table converters next door are a fight, is that a report has no position. Everything awkward about tables here comes from having to write something at a place the rewriter has already passed; an audit writes nothing, so the awkwardness disappears and one pass is enough - including for the part that cannot be decided locally.
A headers attribute names ids, and an id can be defined after the reference that uses it, anywhere in the document. So "does this headers attribute point at anything" is a question with no answer at the moment it is asked. The program collects both sides and reconciles them in an OnDocumentEnd handler, which is the one position that has seen everything - and the same reason a rewrite that needed this would have to read the document twice.