WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: table cells, th-mapping

for

From: Jonathan Avila
Date: Mar 16, 2021 10:02AM


Glenn, I think it's say a td could point to another to the id of td or th that then points to another th - sort of chaining of headers without directly referencing them.

Jon

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of glen walker
Sent: Tuesday, March 16, 2021 11:54 AM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] table cells, th-mapping

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


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
>
>