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

cells_stubhead() doesn't style the full stubhead when more than 1 spanner level #1827

Open
olivroy opened this issue Aug 14, 2024 · 0 comments
Assignees

Comments

@olivroy
Copy link
Collaborator

olivroy commented Aug 14, 2024

Works as expected

library(gt)

exibble |>
  gt::gt(rowname_col = "row") |>
  tab_spanner("spanners", c(char, num)) |>
  # tab_spanner("spanne2rs", c(char, num)) |>
  
  tab_stubhead("Stub row") |>
  tab_style(
    style = cell_fill("#f0f0f0"),
    cells_stubhead()
  ) 

image

The top left cell isn't styled when there are 2 spanner levels

two_levels <- exibble |>
  gt::gt(rowname_col = "row") |>
  tab_spanner("spanners", c(char, num)) |>
  tab_spanner("spanne2rs", c(char, num)) |>
  
  tab_stubhead("Stub row") |>
  tab_style(
    style = cell_fill("#f0f0f0"),
    cells_stubhead()
  )
two_levels

image

Surprisingly, this works as expected in grid!

plot(two_levels)

image

I would expect the html (and LaTeX) output to look like the grid output

I am using the latest gt version with 0.11.0.9000. Verified that this was an issue in 0.10.1 as well

@olivroy olivroy changed the title cells_stubhead() doesn't style the full stub when more than 1 spanner cells_stubhead() doesn't style the full stubhead when more than 1 spanner Aug 14, 2024
@olivroy olivroy changed the title cells_stubhead() doesn't style the full stubhead when more than 1 spanner cells_stubhead() doesn't style the full stubhead when more than 1 spanner level Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants