blob: 4aff116bad9759c9132a4f74e7c86481e1a9b7b4 [file] [log] [blame]
Hao Zhue10cfd32017-02-21 16:41:14 -05001---
2title: add_footnote - HTML
3output: html_document
Hao Zhu94956582017-02-21 18:18:29 -05004vignette: >
5 %\VignetteIndexEntry{Use add_footnote in HTML document}
6 %\VignetteEngine{knitr::rmarkdown}
7 %\VignetteEncoding{UTF-8}
Hao Zhue10cfd32017-02-21 16:41:14 -05008---
9
10# Through Pandoc
11```{r through_pandoc}
12library(knitr)
13library(kableExtra)
14dt <- mtcars[1:5, 1:2]
15colnames(dt)[1] <- c("mpg[note]")
16rownames(dt)[2] <- c("Mazda RX4 Wag[note]")
17dt[3, 2] <- paste0(dt[3, 2], "[note]")
18
19kable(dt) %>%
20 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
21```
22
23# Through HTML
24## Plain HTML
25```{r through_html}
26kable(dt, format = "html") %>%
27 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
28```
29
30## HTML + bootstrap table
31```{r through_html_bootstrap}
Hao Zhua3fc0c42017-02-27 12:04:59 -050032kable(dt, format = "html") %>%
33 kable_styling() %>%
Hao Zhue10cfd32017-02-21 16:41:14 -050034 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
35```
36