paint_table: Paint table elements

View source: R/paint_table.R

paint_tableR Documentation

Paint table elements

Description

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.

Usage

paint_table(
  tbl,
  rows = everything(),
  columns = everything(),
  fill_color = NULL,
  text_color = NULL,
  fill_colour = NULL,
  text_colour = NULL
)

Arguments

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.

Value

A gt table

Examples

head(mtcars) %>% table_format() %>%
  paint_table(rows = 2:3, columns = 4, fill_color = "pink", text_color = "red")

Faunalytics/faunalytics documentation built on Nov. 2, 2024, 12:05 a.m.