great-tables
great-tables copied to clipboard
`tab_style` styles not applied when spanning columns
Prework
- [X] Read and agree to the code of conduct and contributing guidelines.
- [X] If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
Description
When applying styles to a cell that spans multiple columns, some styles do not appear.
Reproducible example
- [x] Post a minimal reproducible example (MRE) so the maintainer can troubleshoot the problems you identify. A reproducible example is:
- [x] Runnable: post enough code and data so any onlooker can create the error on their own computer.
- [x] Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
- [x] Readable: format your code according to the Style Guide for Python Code.
This example is taken from the documentation for location selection.
from great_tables import GT, loc, style, exibble
(
GT(exibble)
.tab_header("A title", "A subtitle")
.tab_style(
style.fill("yellow"),
loc.title(),
)
)
Expected result
I expected the styles (in this case, yellow highlight) to be applied.
Development environment
- Operating System: macOSX
- great_tables Version: 0.17.0
Additional context
Related issue: https://github.com/posit-dev/positron/issues/7535
I was doing a bit of debugging when I believed this to be a Positron issue, so here are some of my findings, if it's helpful:
- this only happens on styles that span multiple columns, eg, this example highlighting certain cells does seem to work
- I was only using pandas dataframes, with
pandas==2.2.3, so I'm not sure if this is a pandas-only issue - this works correctly when using
.show("browser") - I was able to reproduce this behavior in Positron, VSCode using Quarto files, and VSCode using Jupyter Notebooks