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

How to change the font (ex. italics) for an entire specific column (Just rows not header) in ggtexttable #129

Closed
ricschwarz opened this issue Nov 1, 2018 · 2 comments

Comments

@ricschwarz
Copy link

ricschwarz commented Nov 1, 2018

Hi I am learning how to include tables in figures using ggtexttable.
How can I change the font (ex. italics) for an entire specific column (Just rows not header).
I tried inside theme() but I can't specify all rows from a single column. Using tbody.style I can change the entire column but not specific rows or columns. Using table_cell_font(...) it is possible but just one cell at time, not handy when you have many columns or lines. Is there a way to do this? thanks for the support. Cheers Rick

@ricschwarz ricschwarz changed the title How to change the font (ex. italics) for an entire specific column (Just rows not header) How to change the font (ex. italics) for an entire specific column (Just rows not header) in ggtexttable Nov 1, 2018
@kassambara
Copy link
Owner

This feature is now possible.

# Table cells background and font for column 3, 
# Spaning from row 2 to the last row in the data
suppressPackageStartupMessages(library("ggpubr"))
df <- head(iris)
ggtexttable(df, rows = NULL, theme = ttheme("classic")) %>%
  table_cell_bg(row = 2:(nrow(df)+1), column = 3, fill = "darkblue") %>%
  table_cell_font(row = 2:(nrow(df) +1), column = 3, face = "italic", color = "white")

Created on 2020-06-09 by the reprex package (v0.3.0.9001)

@ricschwarz
Copy link
Author

ricschwarz commented Jun 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants