---
title: "Untitled"
author: "Author"
output: html_document
---
```{r echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(kableExtra)
dt <- mtcars[1:5, 1:6]
kbl(dt) %>%
kable_classic() %>%
add_header_above(c(" " = 1, "Group 1" = 3, "Group 2" = 1, "Group 3" = 2))
dt %>%
kbl(caption = "Recreating booktabs style table") %>%
kable_classic(full_width = F, html_font = "Cambria")
dt %>%
kbl() %>%
kable_classic_2(full_width = F)
dt %>%
kbl() %>%
kable_material_dark()
vs_dt <- iris[1:10, ]
vs_dt[1:4] <- lapply(vs_dt[1:4], function(x) {
cell_spec(x, bold = T,
color = spec_color(x, end = 0.9),
font_size = spec_font_size(x))
})
vs_dt[5] <- cell_spec(vs_dt[[5]], color = "white", bold = T,
background = spec_color(1:10, end = 0.9, option = "A", direction = -1))
kbl(vs_dt, escape = F, align = "c") %>%
kable_classic("striped", full_width = F)
```