【问题标题】:How to fix the columns of dataTables when scrolling in shiny滚动闪亮时如何修复数据表的列
【发布时间】:2015-03-12 22:04:06
【问题描述】:

我想冻结表头和(或)表的第一列,这是我们在 Excel 中使用闪亮的 renderDataTable 时可以轻松完成的操作。 我想我们可以在下面的链接中插入 dataTable 的扩展: http://datatables.net/extensions/fixedcolumns/

但是我对java不太了解,有人可以提供一个关于在shiny中实现扩展的例子吗? 非常感谢。

【问题讨论】:

标签: r datatables shiny


【解决方案1】:

使用googleVis 包可能会有所帮助

library(shiny)
library(googleVis)
runApp(
  list(ui = pageWithSidebar(
    headerPanel("googleVis on Shiny"),
    sidebarPanel(
      selectInput("dataset", "Choose a data:",
                  choices = c("rock", "pressure", "cars"))
    ),
    mainPanel(
      htmlOutput("table")
          )
  ),
  server =function(input, output)({
    output$table <- renderGvis({
      ## Table with enabled paging
      tbl2 <- gvisTable(Population, options=list(page='enable', height=300, alternatingRowStyle = T), chartid = "mytable")
      tbl2
    })    
  })
  )
)

【讨论】:

猜你喜欢
  • 2020-06-12
  • 2015-12-20
  • 2019-10-10
  • 2021-01-03
  • 2015-07-22
  • 2019-02-22
  • 2019-02-18
  • 2014-10-13
  • 2019-05-06
相关资源
最近更新 更多