Learn R Programming

tableHTML (version 2.1.2)

add_css_thead: Add css to the thead tag

Description

add_css_thead will add css to the thead tag i.e. to headers and second_headers.

Usage

add_css_thead(tableHTML, css)

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.

Details

add_css_thead will add css to the thead tag i.e. to headers and second_headers.

Examples

Run this code
tableHTML(mtcars) %>% 
  add_css_thead(css = list('background-color', 'lightgray')) 
  
tableHTML(mtcars) %>% 
  add_css_thead(css = list('background-color', 'lightgray')) %>%
  add_css_thead(css = list('background-color', 'lightblue')) 
  
tableHTML(mtcars) %>% 
  add_css_thead(css = list('background-color', 'lightgray')) %>%
  add_css_thead(css = list('text-align', 'center'))
  

Run the code above in your browser using DataLab