如何在滚动时修复dataTables的列

时间:2022-04-17 12:51:16

I want to freeze the header and(or) the first column of the table as what we can do easily in Excel when using renderDataTable in shiny. I guess we can plug in the extensions of dataTable in the link below: http://datatables.net/extensions/fixedcolumns/

我希望冻结标题和(或)表格的第一列,因为在使用renderDataTable闪亮时我们可以在Excel中轻松完成。我想我们可以在下面的链接中插入dataTable的扩展名:http://datatables.net/extensions/fixedcolumns/

But I don't know much about java, can anybody provide an example about implementing the extensions in shiny? Thanks a lot.

但是我对Java知之甚少,有人可以提供一个关于在闪亮中实现扩展的例子吗?非常感谢。

1 个解决方案

#1


1  

Mayb using googleVis package can be of help

Mayb使用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
    })    
  })
  )
)

#1


1  

Mayb using googleVis package can be of help

Mayb使用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
    })    
  })
  )
)