mch*_*hen 8 r datatables shiny jquery-datatables
我有一个数据表中[R闪亮,并希望有一个标题跨越多个列如下图所示:

如何在R Shiny中实现这一目标?
Theres已经是一个例子 http://rstudio.github.io/DT/
library(DT)
sketch = htmltools::withTags(table(
class = 'display',
thead(
tr(
th(rowspan = 2, 'Species'),
th(colspan = 2, 'Sepal'),
th(colspan = 2, 'Petal')
),
tr(
lapply(rep(c('Length', 'Width'), 2), th)
)
)
))
datatable(iris[1:20, c(5, 1:4)], container = sketch, rownames = FALSE)
Run Code Online (Sandbox Code Playgroud)