
Functions to get or set the background color property of huxtable cells.
background_color(ht)
background_color(ht) <- value
set_background_color(ht, row, col, value, byrow = FALSE)
A huxtable.
A character vector or matrix of valid R color names. Set to NA
to reset to the default, which is
NA
.
A row specifier. See rowspecs
for details.
An optional column specifier.
If TRUE
, fill in values by row rather than by column.
For background_color
, the background_color
property.
For set_background_color
, the ht
object.
Other formatting functions: bold
,
font_size
, font
,
na_string
, number_format
,
text_color
# NOT RUN {
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))
# }
Run the code above in your browser using DataLab