【发布时间】:2018-01-10 10:31:01
【问题描述】:
我需要以下 R 脚本的以下要求。当您单击顶部的侧边栏符号时,当仪表板主体展开时,所有小部件都在一行中,但是当仪表板主体缩小时,dateRangeInput 小部件出现在下一行中。我希望所有小部件都出现在一行中并相应地调整大小。请帮助和感谢。
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
box(title = "Data", fluidPage(
div(style = "display: inline-block;vertical-align:top; width: 600 px;",
selectInput("select1","select1",c("A1","A2","A3")),selected = "A1"),
div(style = "display: inline-block;vertical-align:top; width: 600 px;",
selectInput("select2","select2",c("A3","A4","A5")),selected = "A3"),
div(style = "display: inline-block;vertical-align:top; width: 600 px;",
selectInput("select2","select2",c("A3","A4","A5")),selected = "A3"),
div(style = "display: inline-block;vertical-align:top; width: 600 px;",
selectInput("select2","select2",c("A3","A4","A5")),selected = "A3"),
div(style = "display: inline-block;vertical-align:top; width: 600 px;",
dateRangeInput("daterange1", "Date range:",
start = "2001-01-01",
end = "2010-12-31")
),
status = "primary", solidHeader = T, width = 12, height = 120)
)
))
server <- function(input, output) { }
shinyApp(ui, server)
【问题讨论】:
-
我已经使用 tags$style 修复了 daterangebar 的高度问题。请帮助我现在解决调整大小的问题。
标签: css r shiny shinydashboard