You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Load required packages
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(gt)
# Create a tibble
islands_tbl <-
dplyr::tibble(
name = names(islands),
size = islands
) %>%
dplyr::arrange(desc(size)) %>%
dplyr::slice(1:10)
# Make a gt table with row names (i.e., stub)
islands_tbl %>%
gt::gt(rowname_col = "name")
Thanks @jooyoungseo ! I'll definitely get this change made soon when I start on the accessibility pass. If you find any more aspects of HTML tables that are suboptimal for accessibility, please file those as issues as well.
rich-iannone
changed the title
Row names (i.e., stub) have to use <th> tag for accessibility
[accessibility] Row names (i.e., stub) have to use <th> tag
Nov 8, 2020
Currently,
stub
(AKA, row names) are denoted with<td>
tag for html output.However, this is not a recommended practice for accessibility purpose.
As of writing this issue, the row names are not auto-announced when navigating row by row with screen readers.
Please consider using
<th>
instead. That will resolve this issue.Plus, ideally, it would be best if we could add scope = "row" attribute as well.
Please consult with this technical spec.
Reprex
Created on 2020-11-07 by the reprex package (v0.3.0.9001)
Session info
The text was updated successfully, but these errors were encountered: