Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 1 | --- |
| 2 | title: "kable_styling - HTML" |
| 3 | output: html_document |
| 4 | vignette: > |
| 5 | %\VignetteIndexEntry{htmlTable Styling Guide} |
| 6 | %\VignetteEngine{knitr::rmarkdown} |
| 7 | %\VignetteEncoding{UTF-8} |
| 8 | --- |
| 9 | |
| 10 | # Plain HTML |
| 11 | ```{r} |
| 12 | library(knitr) |
| 13 | library(kableExtra) |
| 14 | dt <- mtcars[1:5, 1:2] |
| 15 | |
| 16 | kable(dt, format = "html") |
| 17 | ``` |
| 18 | |
| 19 | # Basic Bootstrap Table |
| 20 | ```{r} |
| 21 | kable(dt, format = "html") %>% |
| 22 | kable_styling() |
| 23 | ``` |
| 24 | |
| 25 | # Boostrap Table Options |
| 26 | ## Striped |
| 27 | ```{r} |
| 28 | kable(dt, format = "html") %>% |
| 29 | kable_styling(bootstrap_options = "striped") |
| 30 | ``` |
| 31 | |
| 32 | ## Striped + Hover |
| 33 | ```{r} |
| 34 | kable(dt, format = "html") %>% |
Hao Zhu | a3fc0c4 | 2017-02-27 12:04:59 -0500 | [diff] [blame] | 35 | kable_styling(c("striped", "hover", "primary")) |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 36 | ``` |
| 37 | |
| 38 | ## Other bootstrap options |
| 39 | ```{r} |
| 40 | kable(dt, format = "html") %>% |
| 41 | kable_styling(c("striped", "bordered", "hover", "condensed", "responsive")) |
| 42 | ``` |
| 43 | |
| 44 | # "Thin" Table and Floating options |
| 45 | ```{r} |
| 46 | kable(dt, format = "html") %>% |
| 47 | kable_styling(c("striped", "bordered", "condensed"), full_width = F) |
| 48 | ``` |
| 49 | |
Hao Zhu | a3fc0c4 | 2017-02-27 12:04:59 -0500 | [diff] [blame] | 50 | ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, |
| 51 | ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, |
| 52 | ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 53 | ```{r} |
| 54 | kable(dt, format = "html") %>% |
Hao Zhu | a3fc0c4 | 2017-02-27 12:04:59 -0500 | [diff] [blame] | 55 | kable_styling(c("striped", "condensed"), full_width = F, |
| 56 | position = "float_right", font_size = 10) %>% |
| 57 | add_header_above(c(" ", "Names[note]" = 2)) %>% |
| 58 | add_footnote("footnote") |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 59 | ``` |
| 60 | |
Hao Zhu | a3fc0c4 | 2017-02-27 12:04:59 -0500 | [diff] [blame] | 61 | ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, ;ojadsf sadfls;af ewejdalsf,asf ,weifojsfakslf, |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 62 | |