add_css_row: Add css to tableHTML's rows

View source: R/add_row_css.R

add_css_rowR Documentation

Add css to tableHTML's rows

Description

add_css_row will add css to a tableHTML's rows

Usage

add_css_row(tableHTML, css, rows = NULL)

Arguments

tableHTML

A tableHTML object created by the tableHTML function.

css

A list of two elements with the corresponding css. The first element of the list should be an atomic vector with the style definitions (e.g. background-color). The second element will be an atomic vector with the same length as the first element, which will contain the style definitions' values (e.g. red). Check the examples for more information.

rows

A numeric atomic vector with the indices of the rows on which the style definitions will be applied. headers and second_headers are included in the rows.Default is NULL which means that it will be applied to all rows.

Details

add_css_row will add css to a tableHTML's rows. The only thing you need to be cautious about is the rows argument. headers and second_headers are still considered rows. add_css_row affects the tr tag of the HTML code internally.

Value

A tableHTML object.

Examples

tableHTML(mtcars) %>% 
  add_css_row(css = list(c('background-color', 'border'), c('lightgray', '3px solid green'))) 

tableHTML(mtcars) %>% 
  add_css_row(css = list(c('background-color', 'border'), c('lightgray', '3px solid green')), 
              rows = 1:33)
        

tableHTML documentation built on April 18, 2023, 1:11 a.m.