Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 1 | --- |
| 2 | title: "add_header_left" |
| 3 | output: |
| 4 | pdf_document: |
| 5 | keep_tex: true |
| 6 | --- |
| 7 | |
| 8 | ```{r} |
| 9 | library(knitr) |
| 10 | library(kableExtra) |
| 11 | |
| 12 | mtcars[1:10, 1:6] %>% |
| 13 | kable("latex", booktabs= T) %>% |
Hao Zhu | bf5bfe2 | 2017-06-21 14:37:41 -0400 | [diff] [blame^] | 14 | kable_styling(latex_options = "striped") %>% |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 15 | add_header_above(c(" ", "a%" = 3, "b" = 3)) %>% |
Hao Zhu | bf5bfe2 | 2017-06-21 14:37:41 -0400 | [diff] [blame^] | 16 | add_header_left(c("a%knjnuulkjlkj" = 3, "b" = 7), "new", align = "l") %>% |
Hao Zhu | 32f43f7 | 2017-06-20 18:24:54 -0400 | [diff] [blame] | 17 | add_header_left(c("aadjfoi adlfsjs adsa" = 4, "b" = 6), "new2", width = "1.5cm") %>% |
| 18 | add_header_left(c("a" = 5, "b" = 5), "xx", width = "1cm", align = "r") |
Hao Zhu | 2ce42b9 | 2017-06-15 17:15:33 -0400 | [diff] [blame] | 19 | ``` |