[whatwg] Proposals for better support of Tables

<C282E02B-2BA6-455A-B275-DCC8B3D8621A@4d.com>

Current votes: None.


The HTML Table API provides powerful attributes like:
- "scope"
- "headers"
- "colspan"
- "rowspan"

All of them give informations about relationships between the table cells, =
rows, and columns

It would be very helpful if:
 - each "th" element could have a "cells" property which would be the HTML =
Collection of each "td" they are heading
 - each "td" element could have a "headerCells" property which would be the=
 HTML Collection of each of their related "th"
 - each cell element could have "rows" and "columns" properties which would=
 be the HTML collection of each rows and columns covered by their rowspan a=
nd colspan attributes

Actually we can use getElementByClassName(), so we often see

<tr><th id=3D"th1" colspan=3D"2">MySection</th></tr>
<tr><th id=3D"th2" class=3D"child-of-th1" scope=3D"row">MyName</th><td>MyDa=
ta</td></tr>
<tr><th id=3D"th3" class=3D"child-of-th2" scope=3D"row">+ MySubName</th><td=
>MySubData</td></tr>
 =20
instead of

<tr><th id=3D"th1" colspan=3D"2">MySection</th></tr>
<tr><th id=3D"th2" headers=3D"th1" scope=3D"row">MyName</th><td>MyData</td>=
</tr>
<tr><th id=3D"th3" headers=3D"th1 th2" scope=3D"row">+ MySubName</th><td>My=
SubData</td></tr>
 =20
which would be semantically more expressive and better for screenreaders


About "headers" I wonder if this would be acceptable:

<tr><th id=3D"th1" colspan=3D"2">MySection</th></tr>
<tr><th id=3D"th2" headers=3D"th1" scope=3D"row">MyName</th><td>MyData</td>=
</tr>
<tr><th id=3D"th3" headers=3D"th2" scope=3D"row">+ MySubName</th><td>MySubD=
ata</td></tr>

as for the third row, the th1 header is implicit from the th2 declared head=
er