Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 1 | ## ------------------------------------------------------------------------ |
| 2 | library(knitr) |
| 3 | library(kableExtra) |
| 4 | dt <- mtcars[1:5, 1:2] |
| 5 | |
| 6 | kable(dt, format = "html") |
| 7 | |
| 8 | ## ------------------------------------------------------------------------ |
| 9 | kable(dt, format = "html", table.attr = htmlTable_styling()) |
| 10 | |
| 11 | ## ------------------------------------------------------------------------ |
| 12 | kable(dt, format = "html", table.attr = htmlTable_styling(bootstrap_options = "striped")) |
| 13 | |
| 14 | ## ------------------------------------------------------------------------ |
| 15 | kable(dt, format = "html", table.attr = htmlTable_styling(c("striped", "hover"))) |
| 16 | |
| 17 | ## ------------------------------------------------------------------------ |
| 18 | kable(dt, format = "html", |
| 19 | table.attr = htmlTable_styling(c("striped", "bordered", "hover", "condensed", "responsive"))) |
| 20 | |
| 21 | ## ------------------------------------------------------------------------ |
| 22 | kable(dt, format = "html", |
| 23 | table.attr = htmlTable_styling( |
| 24 | c("striped", "bordered", "condensed"), |
| 25 | full_width = F, |
| 26 | float = "center" |
| 27 | )) |
| 28 | |