-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdt-css.Rmd
44 lines (39 loc) · 923 Bytes
/
dt-css.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: "dt-css"
output:
html_document:
# theme: NULL
keep_md: TRUE
css: "flat-table.css"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r echo=FALSE}
library(magrittr)
mtcars %>%
# table_patient() %>%
DT::datatable()
mtcars %>%
# table_patient() %>%
DT::datatable(
colnames = gsub("_", " ", colnames(.)),
escape = FALSE,
options = list(
pageLength = 30,
dom = 'tip',
columnDefs = list(
list(className = 'column-row-index', targets = 0),
list(className = 'column-mpg', targets = 1),
list(className = 'column-cyl', targets = 4),
list(className = 'column-hp', targets = 6)
),
class = "aaaaa"
# initComplete = DT::JS(
# "function(settings, json) {",
# "$(this.api().table().header()).css({'background-color': '#555', 'color': '#fff'});",
# "}"
# )
)
)
```