R闪亮滚动wellPanel

rmf*_*rmf 11 r shiny

是否可以滚动井板或柱?

我这里有一个简单的ui方案.

shinyUI(
  fluidPage(
    sidebarLayout(
      sidebarPanel(
        wellPanel(),
        wellPanel()

        ),
        mainPanel(
          fluidRow(
            column(3,
             wellPanel()
            )
          )
        )
    )
  )
)
Run Code Online (Sandbox Code Playgroud)

我想让一些wellPanels(里面的表格)可滚动.

我尝试在'sidebarPanel(')下面添加下面这段代码,但这使得我的整个侧边栏会滚动.我希望将'wellPanel'或'column'设置为可滚动.

tags$head(tags$style(
  type = 'text/css',
  'form-group { max-height: 600px; overflow-y: auto; }')
Run Code Online (Sandbox Code Playgroud)

谢谢

rmf*_*rmf 17

感谢Carlos Sanchez,答案如下:

wellPanel(id = "tPanel",style = "overflow-y:scroll; max-height: 600px",
other-stuff..)
Run Code Online (Sandbox Code Playgroud)

  • Oskar Forsmo意识到了这一点.我使用内联无线电小部件,在CSS中设置`position:relative`.我只需将其添加到面板的`style`中,然后您的解决方案就能完美运行. (2认同)