闪亮的仪表板布局:如何使侧杆与超长的车身内容对齐?

时间:2018-06-05 20:08:24

标签: r shiny flexdashboard

我正在使用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))
    )
   }
  ) 

```

我想知道如何让侧栏与超长桌一起延伸,这意味着避免底部的丑陋边缘:  enter image description here

任何帮助表示赞赏! 应该是一个简单的解决方案,但我自己也找不到解决方案...

1 个答案:

答案 0 :(得分:1)

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

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