kable(head(mtcars) %>%
kable_styling(bootstrap_options = c("striped", "hover"))
A normal R Markdown document, utilizing a kable table (see above), is quite striking and looks like this:
However, when I use the same code chunk in blogdown, the kable table is printed in a more minimalist fashion, which I don't really want. It's just hard to read:
How do I get blogdown to maintain the properties of a normal kable table? I have updated all my packages via update.packages(ask = FALSE, checkBuilt = TRUE)
and tinytex::tlmgr_update()
.
The appearances of the tables are controlled by the Hugo theme of your blogdown site. If the table styles are missing, you won't get those pretty tables.
Try adding the following CSS code in the CSS file of your blogdown sites.
table {
margin: auto;
border-top: 1px solid #666;
border-bottom: 1px solid #666;
}
table thead th { border-bottom: 1px solid #ddd; }
th, td { padding: 5px; }
tr:nth-child(even) { background: #eee; }
You can read more from the blogdown manual to learn how to custom your blogdown site.