【问题标题】:Is colspan with renderDataTable possible in shiny?带有renderDataTable的colspan是否可以闪亮?
【发布时间】:2014-08-30 11:26:17
【问题描述】:

是否可以将 colspan 与 renderDataTable 一起使用(或通过其他一些技巧)来生成如下表格:https://datatables.net/examples/basic_init/complex_header.html



编辑:在闪亮组中也问过(https://groups.google.com/forum/#!topic/shiny-discuss/OQ1MNRgItn4

【问题讨论】:

    标签: r datatables shiny


    【解决方案1】:

    请看这里https://rstudio.github.io/DT/ 第 2.6 节自定义表格容器

    # a custom table container
    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)
        )
      )
    ))
    print(sketch)
    

    【讨论】:

      猜你喜欢
      • 2020-12-26
      • 2018-05-02
      • 2020-09-18
      • 2021-11-21
      • 2019-05-03
      • 2014-07-06
      • 2018-07-30
      • 1970-01-01
      • 2016-01-02
      相关资源
      最近更新 更多