great-tables icon indicating copy to clipboard operation
great-tables copied to clipboard

`tab_style` styles not applied when spanning columns

Open isabelizimm opened this issue 6 months ago • 0 comments

Prework

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

isabelizimm avatar May 27 '25 20:05 isabelizimm