grimbough / msmbstyle

Tufte inspired bookdown template
https://www-huber.embl.de/users/msmith/msmbstyle/
59 stars 17 forks source link

table row stripes from kableExtra? #15

Closed ericpgreen closed 5 years ago

ericpgreen commented 5 years ago

Is it possible to use row stripes from kableExtra in this template? I have not been able to get the color to appear when compiling in bookdown, but it works with a regular Rmarkdown document.

library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:6]
kable(dt) %>%
  kable_styling(bootstrap_options = c("striped", "hover"))
ericpgreen commented 5 years ago

Turns out the answer is yes. The issue is with bookdown, not this template. I found this great example book by the package author.

The key is to load:

library(kableExtra)
options(kableExtra.html.bsTable = T)