| background_color {huxtable} | R Documentation |
Functions to get or set the background color property of huxtable table cells.
background_color(ht) background_color(ht) <- value set_background_color(ht, row, col, value, byrow = FALSE)
ht |
A huxtable. |
value |
A character vector or matrix of valid R color names. Set to |
row |
A row specifier. See |
col |
An optional column specifier. |
byrow |
If |
For background_color, the background_color attribute.
For set_background_color, the ht object.
Other formatting functions: bold,
font_size, font,
na_string, number_format,
text_color
ht <- huxtable(a = 1:3, b = 1:3) background_color(ht) <- grey(.95) background_color(ht) ht <- huxtable(a = 1:3, b = 3:1) set_background_color(ht, grey(.95)) set_background_color(ht, 1:2, 1, grey(.95)) set_background_color(ht, 1:2, 1:2, c(grey(.95), 'yellow'), byrow = TRUE) set_background_color(ht, where(ht == 1), grey(.95))