paint_table | R Documentation |
This function allows you to change the colors cells and text in the body of the table. Header text should be changed with a table_format function.
paint_table(
tbl,
rows = everything(),
columns = everything(),
fill_color = NULL,
text_color = NULL,
fill_colour = NULL,
text_colour = NULL
)
tbl |
A table made with table_format, demo_table_format, or gt |
rows |
Index numbers of rows to change. If left blank, every row will be affected. Ranges should be specified using colon notation (e.g., rows = 2:3) |
columns |
Names or index numbers of rows to change. If left blank, every column will be affected. Ranges should be specified using colon notation (e.g., columns = mpg:cyl or columns = 1:2) |
fill_color |
color to fill cells with. If blank, the fill won't be changed. You may also use fill_colour. |
text_color |
color to change text colort o. If blank, the text color won't be changed. You may also use text_colour. |
fill_colour |
See fill_color. |
text_colour |
See text_color. |
A gt table
head(mtcars) %>% table_format() %>%
paint_table(rows = 2:3, columns = 4, fill_color = "pink", text_color = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.