Color the background cells based on how the value compares to the project average. The project average must be the last row of the table. A footnote is added to the table describing what the dark and light colors mean.
Usage
format_ft_colors(
ft,
lighter_color = "#F2F0E6",
darker_color = "#ccc29c",
language = "English"
)
Examples
# Read in wrangled example table data
tables_path <- soils_example("tables.RDS")
tables <- readRDS(tables_path)
# Make the table
ft <- flextable::flextable(tables$biological)
ft
# Conditionally format background cell colors
format_ft_colors(ft)