在下面的应用程序中,我想将 ashinyWidgets::pickerInput
inline
放在shiny::selectInput
. 两个相同类型的输入(或pickerInput
或selectInput
)可以放在同一行,只需将它们包装在 a 中即可div(style = "inline-block")
。虽然下面的应用程序将输入放在同一行/行上,但它们在垂直方向上并不相同。我查看了 DOM 检查器,但不明白为什么会发生这种情况以及如何解决它。任何帮助表示赞赏。
library(shiny)
library(shinydashboard)
library(shinyWidgets)
shinyApp(ui = dashboardPage(
header = dashboardHeader(title = "Test"),
sidebar = dashboardSidebar(disable = TRUE),
body = dashboardBody(
div(style = "display: inline-block;",
selectInput("test",
"Select Input",
choices = 1:3)
),
div(style = "display: inline-block;",
pickerInput(
inputId = "somevalue",
label = "A label",
choices = c("a", "b")
)
)
) # close dashbaordBody
), # close dashboardPage
server = function(input, output, session) {
})