Skip to contents

Apply styles to an entire row identified by an expression.

Usage

grid_style_row(
  grid,
  expr,
  background = NULL,
  color = NULL,
  fontWeight = NULL,
  ...,
  class = NULL,
  cssProperties = NULL
)

Arguments

grid

A grid created with datagrid().

expr

An expression giving position of row. Must return a logical vector.

background

Background color.

color

Text color.

fontWeight

Font weight, you can use "bold" for example.

...

Other CSS properties.

class

CSS class to apply to the row.

cssProperties

Alternative to specify CSS properties with a named list.

Value

A datagrid htmlwidget.

Examples

library(toastui)

datagrid(mtcars) %>%
  grid_style_row(
    mpg > 19,
    background = "#F781BE"
  )
datagrid(mtcars) %>% grid_style_row( vs == 0, background = "#E41A1C80", color = "#FFF" ) %>% grid_style_row( vs == 1, background = "#377EB880" )
# Use rlang to use character library(rlang) my_var <- "disp" datagrid(mtcars) %>% grid_style_row( !!sym(my_var) > 180, background = "#F781BE" )