Learn R Programming

tableHTML (version 2.1.2)

add_css_header: Add css to tableHTML's headers

Description

add_css_header will add css to a tableHTML's headers

Usage

add_css_header(tableHTML, css, headers)

Value

A tableHTML object.

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.

headers

A numeric atomic vector with the indices of the headers where the style definitions will be applied on. At least one header index must be provided.

Details

add_css_header will add css to a tableHTML's headers.

Examples

Run this code
tableHTML(mtcars) %>% 
  add_css_header(css = list(c('background-color', 'border'), c('lightgray', '3px solid green')),
                 headers = 2) 

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

Run the code above in your browser using DataLab