【问题标题】:How to make a vertical scroll bar in rhandsontable [Shiny]如何在 rhandsontable [Shiny] 中制作垂直滚动条
【发布时间】:2019-04-03 20:40:32
【问题描述】:

您能否提示如何在 rhandsontable 表中制作垂直滚动条? 到目前为止,我还没有找到明确的指导。 之前的问题是here

脚本草稿在这里:
UI 方面:

column(8,                                              
  rHandsontableOutput("loaded_table")  
)  

服务器端:

output$loaded_table <- renderRHandsontable({
  if (!is.null(descStat))
    rhandsontable(descStat, maxRows = 20)
})

【问题讨论】:

  • 你能发布一些示例代码吗?因为也许这个小 CSS 可以做到overflow-y: scroll;
  • @SeGa 添加了草稿脚本。

标签: r shiny rhandsontable


【解决方案1】:

默认没有垂直滚动吗?

我在这个例子中看到了一个:

library(shiny)
library(rhandsontable)

ui <- fluidPage(
  column(8,
    rHandsontableOutput("loaded_table", height = "200px")
  ) 
)

server <- function(input, output, session) {
  output$loaded_table <- renderRHandsontable({
    rhandsontable(iris, maxRows = 20)
  })
}

shinyApp(ui, server)

【讨论】:

  • 事实上,我有一个水平滚动条,但没有垂直滚动条。我删除了 maxRows 属性 - 没有垂直滚动条。
  • 也没有 maxRows 我看到了一个,因为无论如何我都将表格限制为 200px。你用的是什么版本的 rhandsontable?
  • 包版本是rhandsontable_0.3.7 其实我的想法是做一个固定的可见行输出,但是可以上下滚动。
  • 这很奇怪,但您的脚本运行良好。我不明白为什么我的不。
  • 我来到这里是因为我遇到了类似的问题,上面的脚本在我的完整应用程序中工作 maxRows 没有帮助。最后我使用了height = 200,它最终启用了我的滚动条。
猜你喜欢
  • 1970-01-01
  • 2014-09-02
  • 2021-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-27
  • 2010-11-26
  • 1970-01-01
相关资源
最近更新 更多