Is there a way to set up default kableExtra stylings to be applied to each table in an Rmarkdown document in order to avoid typing the same sytling options over and over again?
In the reprex below, you see that I have to add kable_styling(c("striped", "hover", "condensed", "responsive")) to each kable I want to produce, so I was wondering whether there is maybe an option which allows to define the default styling?
---
title: "Default Kables"
output: html_document
---
```{r setup}
library(kableExtra)
```
```{r mtcars}
mtcars %>%
head() %>%
kable() %>%
kable_styling(c("striped", "hover", "condensed", "responsive"))
```
```{r iris}
iris %>%
head() %>%
kable() %>%
kable_styling(c("striped", "hover", "condensed", "responsive"))
```
Of course there is a trivial solution to define a helper function like this:
kable <- function(...) {
knitr::kable(...) %>%
kable_styling(c("striped", "hover", "condensed", "responsive"))
}
but I was wondering whether there is a dedicated option for that?
