Skip to content

tab_style() fails to target all cell_summary rows with row_group_order() #812

@adietster

Description

@adietster

Try using tab_style to cells_summary with row_group_order in my case will result in missing the style (or unformatted). It happens everytime. I am using latest version of gt from github.

library(dplyr)
library(tidyverse)
library(gt)
library(babynames)

numrows <- 6
numgroups <- 2

df <- tibble::tibble(
  name = sample(babynames$name, numrows), 
  value = runif(numrows, 50000, 2000000), 
  group = sample(letters[1:numgroups], numrows, replace = TRUE)
) 

gttbl <- df %>%
  group_by(group) %>%
  arrange(group) %>%
  gt(rowname_col = "name") %>%
  row_group_order(groups = c("b", "a")) %>%
  summary_rows(groups = TRUE, columns = c(value), fns = list("sum")) %>%
  tab_style(style = list(cell_text(style = "italic", weight="bold")),
            locations = cells_summary())
gttbl

Screen Shot 2021-07-05 at 16 34 10

Screen Shot 2021-07-05 at 16 32 49

Created on 2021-07-05 by the reprex package (v2.0.0)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions