Skip to content

Commit

Permalink
Merge pull request #978 from jooyoungseo/jooyoungseo/issue680
Browse files Browse the repository at this point in the history
[Accessibility] Closing 680: Add scope = "col" for column headers
  • Loading branch information
rich-iannone authored Jul 5, 2022
2 parents c70f65c + d2ee7b4 commit 2634266
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/utils_render_html.R
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ create_columns_component_h <- function(data) {
rowspan = 1,
colspan = length(stub_layout),
style = stubhead_style,
scope = "col",
htmltools::HTML(headings_labels[1])
)

Expand Down Expand Up @@ -432,6 +433,7 @@ create_columns_component_h <- function(data) {
rowspan = 1,
colspan = 1,
style = column_style,
scope = "col",
htmltools::HTML(headings_labels[i])
)
}
Expand Down Expand Up @@ -484,6 +486,7 @@ create_columns_component_h <- function(data) {
rowspan = 2,
colspan = length(stub_layout),
style = stubhead_style,
scope = "col",
htmltools::HTML(headings_labels[1])
)

Expand Down Expand Up @@ -544,6 +547,7 @@ create_columns_component_h <- function(data) {
rowspan = 2,
colspan = 1,
style = heading_style,
scope = "col",
htmltools::HTML(headings_labels[i])
)

Expand Down Expand Up @@ -580,6 +584,7 @@ create_columns_component_h <- function(data) {
rowspan = 1,
colspan = colspans[i],
style = spanner_style,
scope = "col",
htmltools::tags$span(
class = "gt_column_spanner",
htmltools::HTML(spanners[level_1_index, ][i])
Expand Down Expand Up @@ -635,6 +640,7 @@ create_columns_component_h <- function(data) {
),
rowspan = 1, colspan = 1,
style = remaining_style,
scope = "col",
htmltools::HTML(remaining_headings_labels[j])
)
}
Expand Down Expand Up @@ -710,6 +716,7 @@ create_columns_component_h <- function(data) {
rowspan = 1,
colspan = colspans[j],
style = spanner_style,
scope = "col",
if (spanner_ids_row[j] != "") {
htmltools::tags$span(
class = "gt_column_spanner",
Expand All @@ -727,7 +734,8 @@ create_columns_component_h <- function(data) {
htmltools::tagList(
htmltools::tags$th(
rowspan = max(higher_spanner_rows_idx),
colspan = length(stub_layout)
colspan = length(stub_layout),
scope = "col"
),
level_i_spanners
)
Expand Down

0 comments on commit 2634266

Please sign in to comment.