Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 1 | ## ----through_pandoc------------------------------------------------------ |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 2 | library(knitr) |
| 3 | library(kableExtra) |
| 4 | dt <- mtcars[1:5, 1:2] |
| 5 | colnames(dt)[1] <- c("mpg[note]") |
| 6 | rownames(dt)[2] <- c("Mazda RX4 Wag[note]") |
| 7 | dt[3, 2] <- paste0(dt[3, 2], "[note]") |
| 8 | |
| 9 | kable(dt) %>% |
| 10 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 11 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 12 | ## ----through_html-------------------------------------------------------- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 13 | kable(dt, format = "html") %>% |
| 14 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 15 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 16 | ## ----through_html_bootstrap---------------------------------------------- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 17 | kable(dt, format = "html", table.attr = htmlTable_styling()) %>% |
| 18 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 19 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 20 | ## ----through_latex_longtable--------------------------------------------- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 21 | kable(dt, format = "html", |
| 22 | table.attr = htmlTable_styling(c("striped", "bordered"), |
| 23 | full_width = F)) %>% |
| 24 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 25 | |