| --- |
| title: add_footnote - HTML |
| output: html_document |
| vignette: > |
| %\VignetteIndexEntry{Use add_footnote in HTML document} |
| %\VignetteEngine{knitr::rmarkdown} |
| %\VignetteEncoding{UTF-8} |
| --- |
| |
| # Through Pandoc |
| ```{r through_pandoc} |
| library(knitr) |
| library(kableExtra) |
| dt <- mtcars[1:5, 1:2] |
| colnames(dt)[1] <- c("mpg[note]") |
| rownames(dt)[2] <- c("Mazda RX4 Wag[note]") |
| dt[3, 2] <- paste0(dt[3, 2], "[note]") |
| |
| kable(dt) %>% |
| add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
| ``` |
| |
| # Through HTML |
| ## Plain HTML |
| ```{r through_html} |
| kable(dt, format = "html") %>% |
| add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
| ``` |
| |
| ## HTML + bootstrap table |
| ```{r through_html_bootstrap} |
| kable(dt, format = "html") %>% |
| kable_styling() %>% |
| add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
| ``` |
| |