| background_color {huxtable} | R Documentation |
Set cell background color
Description
Colors can be in any format understood by R:
A color name like
"darkred"A HTML string like
"#FF0000"The result of a function like
rgb(1, 0, 0)orgrey(0.5)
Usage
background_color(ht)
background_color(ht) <- value
set_background_color(ht, row, col, value )
map_background_color(ht, row, col, fn)
Arguments
ht |
A huxtable. |
row |
A row specifier. See rowspecs for details. |
col |
An optional column specifier. |
fn |
A mapping function. See mapping-functions for details. |
value |
A character vector or matrix. Set to |
Details
Transparent colors are not guaranteed to work at present.
Value
background_color() returns the background_color property.
set_background_color() returns the modified huxtable.
See Also
Other formatting functions:
bold(),
font_size(),
font(),
na_string(),
number_format(),
text_color()
Examples
background_color(jams) <- grey(0.7)
background_color(jams)
set_background_color(jams, "yellow")
set_background_color(jams,
2:3, 1, "yellow")
map_background_color(jams,
by_rows("yellow", grey(0.7)))
[Package huxtable version 5.5.6 Index]