Reputation:
I'm trying to include kableExtra
table in my ioslides in RStudio. I get the tables correctly, however simple formatting from the vignette examples seems to be gone.
---
title: "Tables"
output:
ioslides_presentation: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:6]
```
## No styling
```{r t1}
dt %>%
kable("html")
```
## Styling
```{r t2}
dt %>%
kable("html") %>%
kable_styling(bootstrap_options = c("striped", "condensed", full_width = F, position = "center"))
```
Any ideas what I'm missing?
Upvotes: 3
Views: 2060
Reputation: 7856
You need to update the kableextra to 0.9.0 or above. Starting from this version, it will automatically load required css into the slides environment.
Update: If it still doesn't work, you can force kableExtra to load the css for you by
options("kableExtra.html.bsTable" = T)
See https://cran.r-project.org/web/packages/kableExtra/news/news.html under kableExtra 0.9.0
Upvotes: 8
Reputation: 31
I solved this issue by including the bootstrap CSS, which are used by kableExtra:
output:
ioslides_presentation:
css: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
Upvotes: 3