Gt: tab_style for summary row labels

Created on 21 Jan 2020  Â·  3Comments  Â·  Source: rstudio/gt

Is there a way to target the label in the stub for styling in a summary row? It seems like the expected behavior when applying a style to a summary row (at least when columns = TRUE) would be to include the label in the stub.

And you can't seem to target it with cells_stub by the aggregator label, which results in the not-very-surprising error Can't bind data because some arguments have the same name.

Thanks!

[3] Advanced [3] High [3] High ★ Enhancement

Most helpful comment

Thanks for bringing this up. Unfortunately, this is the only location that currently can't be accessed by a cells_*() function, which is a shame because these labels are likely prime targets for footnotes and styling.

Also, given that this is the last location that can't be targeted, it blocks work on #176 (creating a cells_all() function).

To solve this, there are a few options I can think of here:

  1. add cells_stub_summary()
  2. augment cells_stub()
  3. augment cells_summary()

To me, the first seems like the best option so as to not clutter the interfaces of the existing cells_*() functions.

All 3 comments

Thanks for bringing this up. Unfortunately, this is the only location that currently can't be accessed by a cells_*() function, which is a shame because these labels are likely prime targets for footnotes and styling.

Also, given that this is the last location that can't be targeted, it blocks work on #176 (creating a cells_all() function).

To solve this, there are a few options I can think of here:

  1. add cells_stub_summary()
  2. augment cells_stub()
  3. augment cells_summary()

To me, the first seems like the best option so as to not clutter the interfaces of the existing cells_*() functions.

I agree that cells_stub_summary() is the way to go here. Feels consistent with the rest of the API. Is `cells_stub_grand_summary() needed also? This would be useful for bolding a grand total row. Example: image

I believe this one also prevents the user from being able to change the font table wide? @rich-iannone If so, surely this one should be labelled as a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TuSKan picture TuSKan  Â·  6Comments

tbradley1013 picture tbradley1013  Â·  3Comments

jestarr picture jestarr  Â·  3Comments

higgi13425 picture higgi13425  Â·  3Comments

vikram-rawat picture vikram-rawat  Â·  3Comments