我正试图在selectInput
旁边的actionButton
框中使用fluidRow
& column
个论点。但是按钮会放在column
的顶部。
使用text-align:center
中的div
将按钮置于column
视图的中心位置。我希望actionButton
与其左侧的selectBox
处于同一高度。
由于CSS
我刚刚开始进入某些Shiny
,但我在这里不知所措。
在此先感谢:)
ui <- fluidPage(title = "Working Title",
sidebarPanel(width = 6,
# *Input() functions
fluidRow(column(6, selectInput("Input1", label = h3("Select Input 1"), choices = list( "A" = "A", "B" = "B"), selected = 1)),
column(6, div(style = "background-color:yellow; text-align:center;", actionButton("goButtonSetInput1", "SetInput1")))
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
答案 0 :(得分:3)
您可以通过添加另一个fluidRow并设置label = NULL
来实现ui <- fluidPage(title = "Working Title",
sidebarPanel(width = 6,
# *Input() functions
fluidRow(column(6, h3("Select Input 1") )),
fluidRow(column(6, selectInput("Input1", label = NULL, choices = list( "A" = "A", "B" = "B"), selected = 1)),
column(6, div(style = "background-color:yellow; text-align:center;", actionButton("goButtonSetInput1", "SetInput1")))
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)