Problem Description
对于一个shiny 的应用程序,我想在我的应用程序中以类似于行的布局并排显示多个selectInputs
.不幸的是,如果标签中出现 break line , destruct 了应用程序的流程,则 Select 字段不会对齐.
Situation
这是我的示例代码,我在selectInput
的描述中修改了示例:
## Only run examples in interactive R sessions
if (interactive()) {
# demoing group support in the `choices` arg
shinyApp(
ui = fluidPage(
mainPanel(
flowLayout(
selectInput("state", "Choose a state:",
list(`East Coast` = list("NY", "NJ", "CT"),
`West Coast` = list("WA", "OR", "CA"),
`Midwest` = list("MN", "WI", "IA")),
),
selectInput("stat2", "Variable description with a way longer description to enforce linebreak:",
list(`East Coast` = list("NY", "NJ", "CT"),
`West Coast` = list("WA", "OR", "CA"),
`Midwest` = list("MN", "WI", "IA")),
)),# end of inputs
textOutput("result"),
width = 12
)),
server = function(input, output) {
output$result <- renderText({
paste("You chose", input$state)
})
}
)
}
其结果是:
Target
我希望输入字段始终处于相同的高度级别,如下所示:
splitLayout
kind of does this, but it breaks down if the page is to narrow for the labels and adds y-scrollers which are complicating the UI, especially for bigger Labels:
不幸的是,我没有WebDev方面的经验,因此有点不知所措.有人能帮我解决这个问题吗?