library(knitr)
library(kableExtra)
library(dplyr)
iris[1:10, 1:4] %>%
  mutate_all(function(x){
    cell_spec(x, "latex", 
              background = spec_color(x), 
              font_size = spec_font_size(x),
              color = "white", bold = T)
    }) %>%
  kable("latex", escape = F, booktabs = T, linesep = "", align = "c") 


haozhu233/kableExtra documentation built on July 14, 2024, 4:48 p.m.