我正在尝试使用selectInputactionButton参数在发光的应用程序中的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)

最佳答案

您可以通过添加另一个fluidRow并设置标签= 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)

07-26 02:41