blob: b5c615cdbf4d09a10fffef9d196362a415e4a6f8 [file] [log] [blame]
Hao Zhu68449202018-10-16 16:01:19 -04001---
2title: "Using kableExtra in Radix"
3description: |
4 A new article describing how to use kableExtra in Radix
5author:
6 - name: Hao Zhu
7 url: https://github.com/haozhu233
8date: "`r Sys.Date()`"
9output: radix::radix_article
10---
11
12People may find some features in `kableExtra`, such as hovering/striped rows are not working in `radix`. The reason is that `kableExtra` relies on `bootstrap` stylesheet to do these jobs while `radix` doesn't have those css load. Therefore you need to tell `kableExtra` to load the table css for you by setting `options(kableExtra.html.bsTable = T)`.
13
14```{r, echo = T}
15library(kableExtra)
16options(kableExtra.html.bsTable = T)
17
18kable(iris[1:6, ], caption = "kable with kableExtra") %>%
19 kable_styling(c("striped", "hover", "condensed"), full_width = F,
20 position = "left") %>%
21 add_header_above(c("numerical" = 4, "categorical" = 1)) %>%
22 column_spec(1, bold = T) %>%
23 row_spec(0, italic = T)
24```
25
26
27Comparing with other table options
28
29```{r, echo = T}
30kable(iris[1:6, ], caption = "Basic kable")
31```
32
33```{r, echo = T}
34rmarkdown::paged_table(iris)
35```