Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
adietster opened this issue Jul 5, 2021 · 1 comment · Fixed by #814
Closed

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

adietster opened this issue Jul 5, 2021 · 1 comment · Fixed by #814

Comments

@adietster
Copy link

adietster commented Jul 5, 2021

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)

@rich-iannone
Copy link
Member

Thank you for reporting this bug. It's high priority so will be the next thing that's worked on.

@rich-iannone rich-iannone changed the title tab_style fails to target all cell_summary rows with row_group_order tab_style() fails to target all cell_summary rows with row_group_order() Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment