- From: Mike Bremford via GitHub <sysbot+gh@w3.org>
- Date: Sat, 24 Oct 2020 12:10:11 +0000
- To: public-css-archive@w3.org
We have the `target-text()` function to display text from another element based on a URI. So if this were implemented in browsers (hint: it's not, although it's in all the CSS-to-PDF engines), you could refer from each `<td>` to its associated `<th>` by id, then use `target-text()` to display the content: ```html <style> td::before { content: target-text(attr(data-th url)); } </style> <table> <tr> <th id="header1">Header Content</th> <td data-th="#header1">Cell content</td> </tr> </table> ``` There's even a pre-existing [headers](https://www.w3.org/TR/WCAG20-TECHS/H43.html) attribute that can be set on the `<td>` to reference the associated `<th>` elements. In theory you could use that, except that it's defined as a _list of ids_ for the associated header(s), not a _url_ - i.e. it would be `<td headers="header1">` - there's no '#' prefix. We could perhaps fix that with something like `attr(headers idref)`, which might be a useful addition to `attr()`. Doing this automatically without an explicit reference would indeed be very complicated - while there is an algorithm for this ([ref](https://html.spec.whatwg.org/multipage/tables.html#header-and-data-cell-semantics)), @fantasai's already made the observation that the whole thing would collapse once you change the display so it's no longer a table. -- GitHub Notification of comment by faceless2 Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5628#issuecomment-715905929 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 24 October 2020 12:10:14 UTC