闪亮的仪表板布局:如何使侧边栏与超长正文内容对齐?

Shiny dashboard Layout: how to make side bar align with extra long body content?

我正在使用 flex 仪表板侧边栏布局:

---
output: 
  flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---

```{r global, include=FALSE, echo=FALSE}

library(shiny)
library(shinydashboard)
library(DT)

data <- data.frame('col1'= rnorm(1000))
```

```{r, echo = FALSE}
shinyApp(
ui <- dashboardPage(
       dashboardHeader(title = 'Test Dashboard'),
        dashboardSidebar(

    sliderInput("fy", label = "Since",
        min = 2015, max = 2030, value = 1, step = 1),

    sliderInput('minCount', label = 'Minimum Count Frequency:', 
  min = 1, max = 20, value = 1, step = 1)

 ),
 dashboardBody(
   column(12,
  dataTableOutput('table')
 )
 )
 ),
  server <- function(input, output) {
   output$table <- renderDataTable(
     datatable(data, options = list(pageLength  = 100))
    )
   }
  ) 

```

我想知道如何让侧边栏随着超长 table 一起延伸,这意味着避免底部出现丑陋的边缘:

感谢任何帮助! 应该很容易解决,但我自己想不出解决方案...

您可以使用 CSS 属性 overflow 使其工作:

dashboardBody(
  tags$head(
    tags$style(
      HTML('.content-wrapper {
               overflow: auto;
           }'
      )
    )
  ),
  column(12,
         dataTableOutput('table')
  )
)