[csswg-drafts] [css-tables] Cell content for colspan and rowspan (#11499)

Crissov has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-tables] Cell content for colspan and rowspan ==
In classic paper typography, it is not uncommon to encounter content repetition symbols or **[ditto marks](https://en.wikipedia.org/wiki/Ditto_mark)** in tables: Often, the local variant of (either opening or closing) double quotation marks is put as the single content of a slot to indicate that it has the same value as the one above. In HTML, one could fill empty `<td>` accordingly, but usually one would use `rowspan` in the top-most cell instead, so it spans several slots. Sometimes, this might also be done (with different synbols) for horizontally adjacent cells. 

If a style author wanted to turn such a table with cells spanning multiple slots into that classic format with ditto marks, there currently is no solution in CSS (as far as I know). There is also no CSS solution to display the same content into all affected slots, which is something that scripts to sort tables regularly need to do.

~~~~ html
<table><thead>
<tr><th>1<th>          2<th>          3</tr>
</thead><tbody>
<tr><td>a<td rowspan=3>b<td>          c</tr>
<tr><td>d               <td rowspan=2>e</tr>
<tr><td>f                              </tr>
<tr><td>g<td>          h<td>          i</tr>
</tbody></table>
~~~~
| 1 | 2 | 3 | ——— | 1 | 2 | 3 |
| --- | --- | --- | --- | --- | --- | --- |
| a | b | c | ——— | a | b | c |
| d | " | e | ——— | d | b | e |
| f | " | " | ——— | f | b | e |
| g | h | i | ——— | g | h | i |

I’m not quite sure how to solve this use case and since CSS Tables is kinda the unloved Cinderella module, I won’t expect a solution any time soon, but I still wanted to raise it.

~~~~css
[rowspan]::slot {content: content();}
[colspan]::slot(n+1) {content: '”';}
~~~~

PS: A [CSS table slot](https://drafts.csswg.org/css-tables-3/#slot) is different from a [shadow tree slot](https://dom.spec.whatwg.org/#shadow-tree-slots) which the `::slotted()` pseudo element function refers to.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11499 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 14 January 2025 15:46:02 UTC