powered by
This function applies alternating background colors (zebra striping) to an html_matrix object, either by rows or by columns.
html_matrix
zebra(x, col = c("#FFFFFF", "#CCCCCC"), byrow = TRUE)
An html_matrix object with updated background colors.
An html_matrix object to which the zebra striping will be applied.
A character vector of colors to use for striping. Defaults to c("#FFFFFF", "#CCCCCC").
c("#FFFFFF", "#CCCCCC")
Logical; if TRUE, colors are applied to rows, otherwise to columns. Default is TRUE.
TRUE
library("magrittr") m <- matrix(1:12, ncol = 4) hm <- html_matrix(m) %>% zebra() html <- toHTML(hm, browser = TRUE)
Run the code above in your browser using DataLab