RFR: JDK-8276800 Fix table headers in NumericShaper.html

Alexey Ivanov aivanov at openjdk.java.net
Wed Nov 10 16:15:36 UTC 2021


On Wed, 10 Nov 2021 11:03:23 GMT, Ludvig Janiuk <duke at openjdk.java.net> wrote:

> Concerning `<tbody>`, quote (emphasis mine):
> 
> > As your tables get a bit more complex in structure, it is useful to give them more structural definition. One clear way to do this is by using `<thead>`, `<tfoot>`, and `<tbody>`, which allow you to mark up a header, footer, and body section for the table.
> 
> > **These elements don't make the table any more accessible to screenreader users**, and don't result in any visual enhancement on their own. They are however very useful for styling and layout — acting as useful hooks for adding CSS to your table.
> 
> Based on this, I don't see a foundation for having several tbodies. Am I missing something?

The definition of [`rowgroup` keyword](https://html.spec.whatwg.org/dev/tables.html#attr-th-scope-rowgroup) is as follows:
> The row group state means the header cell applies to all the remaining cells in the row group. A `th` element's `scope` attribute must not be in the row group state if the element is not anchored in a row group.

As I read the definition, having `<th scope="rowgroup">` requires that the corresponding `th` element is in a row group (`tbody`) and such _a heading applies to all the cells in the row group_. Thus, without creating the second row group the cell `<th scope="rowgroup">Arabic` from the first row applies to all the subsequent cells in the table including `<th scope="rowgroup">Tai Tham`.

[The following example](https://html.spec.whatwg.org/dev/tables.html#the-th-element:attr-th-scope-6) on that page discusses the same situation: a heading cell with `scope="rowgroup"` applies to all the cells in a row group defined by `tbody`. Our situation is similar yet the second row group contains only one row.

It's why I think the table must have *two* row groups: for _Arabic_ and for _Tai Tham_, even though it doesn't change the visual presentation.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6291



More information about the client-libs-dev mailing list