## Use `scope = "col"` for all column headers denoted with `<th>` tags

This is, in effect, the same as the [gt issue #680](https://github.com/rstudio/gt/issues/680), opened by @jooyoungseo. This is currently missing from all of the tables I've generated based on the Quarto docs (e.g. markdown, `knitr::kable()`, DT, Python tabulate, etc.).

WCAG resources: [H63: Using the scope attribute to associate header cells and data cells in data tables](https://www.w3.org/TR/WCAG20-TECHS/H63)

## Use `<th scope="row">` for all row names

See @jooyoungseo's [gt issue #678](https://github.com/rstudio/gt/issues/678) for accessibility implications. In addition to gt, this applies to the default output for `knitr::kable()` and `DT::datatable()`, which include row names. Note also that the empty cell above the row names should be an empty `<td></td>` (as opposed to empty `<th></th>`, as it is now). 

Let me know if you think it would be better to open this issue directly in knitr and DT.

WCAG resources: See H63 (above), and W3C WAI's [Tables with Two Headers](https://www.w3.org/WAI/tutorials/tables/two-headers/).

## Support multi-level and/or irregular headers?  

I think this is currently out of scope for Quarto itself, as (thus far) I've only been able to generate such tables by using gt, kableExtra, and DT with a custom table container.

The easier of the two would be [Tables with Irregular Headers](https://www.w3.org/WAI/tutorials/tables/irregular/), which uses arguments to `<th>` (e.g. `<th colspan="2" scope="colgroup">` for two columns, or `<th rowspan="2" scope="rowgroup">` for two rows).

For [Tables with Multi-Level Headers](https://www.w3.org/WAI/tutorials/tables/multi-level/), such as those generated in gt and with kabelExtra, headers get `id`s, and are then associated with lower `<th>`, and `<td>` elements using `headers="foo bar baz"`. 

Watch related [issue #926 for gt](https://github.com/rstudio/gt/issues/926) for @rich-iannone's forthcoming implementation.
2022-05-31T10:35:29Z
batpigandme
accessibility
Future
open
Improve table markup for accessibility (a11y issue)
https://github.com/quarto-dev/quarto-cli/issues/1025