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

location cells_all() #176

Open
vincentarelbundock opened this issue Feb 13, 2019 · 4 comments
Open

location cells_all() #176

vincentarelbundock opened this issue Feb 13, 2019 · 4 comments

Comments

@vincentarelbundock
Copy link

It would be useful to have a shortcut to apply some styling to all locations:

tab %>% tab_style(style = cells_styles(text_size = 'x-small'),
                  locations = cells_all())
@rich-iannone
Copy link
Member

Thanks for the suggestion! It's a very good idea, especially for that use case of globally modifying the text size.

@gregrs-uk
Copy link

This would be a handy way to set the same font for the entire table too, unless I'm missing another way of accomplishing this.

@jameslairdsmith
Copy link

I think this would be a great feature. Especially for when changing something like the font of an entire table.

However, I think text size might need an additional option on top of this. The reason is that often you won't want to change all the text in a table to the same font size, you will often want to either enlarge or reduce the text size of the different components by a fixed increment. That means that although your footnotes, for example, will be slightly larger, they will still be smaller than the other text in the table. Likewise for the headers and sub-headers etc. still being larger.

It would be useful to be able to specify an anchor_text_size perhaps in the gt() function at the outset? Therein one could specify the size for the text in the normal cells (eg "small") and the text in the other components of the table would adjust to that anchor (eg. "x-small" for the foornotes, "medium" for the sub-heading, "large" for the heading etc).

Another option to achieve this might be to have a helper function like reduce_text_size() which could be specified as a function passed to the fn= argument in text_transform(). It could then be used like so:

a_gt_table %>%
  text_transform(locations = cells_all(),
                 fn = reduce_text_size(by = px(5))

I'm not sure about this though. You maybe want to keep the values of the text and their styles separate.

@kendonB
Copy link

kendonB commented May 11, 2020

@rich-iannone should the difficulty and effort tags for this one be lower? It seems like just addressing the request in the title (for global font changes) would be quite easy?

@rich-iannone rich-iannone added this to the v0.4.0 milestone Apr 27, 2021
@rich-iannone rich-iannone changed the title location cells_all location cells_all() Apr 27, 2021
@rich-iannone rich-iannone modified the milestones: v0.4.0, v0.5.0 Jan 26, 2022
@rich-iannone rich-iannone modified the milestones: v0.5.0, v0.6.0 Mar 1, 2022
@rich-iannone rich-iannone modified the milestones: v0.6.0, v0.7.0 Apr 19, 2022
@rich-iannone rich-iannone modified the milestones: v0.7.0, v0.8.0 May 27, 2022
@rich-iannone rich-iannone removed this from the v0.8.0 milestone Sep 22, 2022
@rich-iannone rich-iannone added this to the FUTURE milestone Sep 22, 2022
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

5 participants