make_css_color_rank_theme {tableHTML} | R Documentation |
Get css properties for custom color rank theme
Description
make_css_color_rank_theme
will create a list of css properties needed for custom conditional formatting.
Usage
make_css_color_rank_theme(
column_data,
colors,
css_property = "background-color",
decreasing = FALSE,
same_scale = TRUE
)
Arguments
column_data |
A named list of vectors of values that are in a tableHTML column which should be mapped to a color palette. |
colors |
colors to interpolate; must be a valid argument to
|
css_property |
Character. An optional character specifying the css attribute
that should be used. Default is |
decreasing |
logical. Should the sort order be increasing or
decreasing? For the |
same_scale |
Logical. This flag indicates whether the condition should be applied to columns individually or
in conjunction. If TRUE, the condition will be evaluated on all values of all |
Details
make_css_color_rank_theme
will add conditional css to a tableHTML's columns. add_conditional_css_column
will only
add css to the columns without the headers or second headers (i.e. it only affects the td tag
internally and not the th tag). If you want to add css to the headers or second headers please
use add_css_header
or add_css_second_header
.
Value
A list of css properties
Examples
tableHTML <- tableHTML(mtcars)
css <- make_css_color_rank_theme(list(mpg = mtcars$mpg),
c("orange", "yellow","springgreen","royalblue"))
tableHTML %>% add_css_conditional_column(conditional = "color_rank",
color_rank_theme = "Custom",
color_rank_css = css, column = 1)