WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: table cells, th-mapping

for

From: glen walker
Date: Mar 16, 2021 9:53AM


Ah, yes, thanks Jonathan.

But there's also the difficult to understand section of the headers spec (
https://www.w3.org/TR/html53/tabular-data.html#element-attrdef-tablecells-headers)
that says

A th <https://www.w3.org/TR/html53/tabular-data.html#elementdef-th> element
A is said to be *targeted* by a th or td
<https://www.w3.org/TR/html53/tabular-data.html#elementdef-td> element B if
either A is *directly targeted* by B or if there exists an element C that
is itself *targeted* by the element B and A is *directly targeted* by C.

I had to read that a dozen times to get it. A td directly targeting a th
via the headers attribute is valid but a td can also target a separate
element (C) if C directly targets the th. I'm not sure how to code that
because even if I could have the td point to the span via headers, I could
not point the span itself to the th via headers because headers is not a
valid attribute for a span.



On Tue, Mar 16, 2021 at 9:40 AM Jonathan Avila < <EMAIL REMOVED> >
wrote:

> It's my understanding that the spec says the ids must point to TH cells
> themselves and not something else like a span inside of them.
>
> https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-headers
>
> Jonathan
>
>