我想创建一个
wellPanel
来保存 shiny
应用程序中的一些输入。下面的代码重现了我正在尝试做的事情。但是,我希望 Section 2
位于 Section 1
旁边,而不是在井的另一侧(参见屏幕截图)。
我怎样才能实现这个目标?请参阅下面的代表。
library(shiny)
ui <- fluidPage(
# Application title
titlePanel("Basic Shiny App"),
# Sidebar layout with input and output definitions
fluidRow(
column(
width = 10, offset = 1,
wellPanel(
div(actionButton("toggle", "Toggle")),
hr(),
div(
id = "some_id",
div(
style = "display: flex; justify-content: space-between;",
div(
style = "flex: 0.2; padding: 5px; background-color: wheat;",
div(
p("Section 1"),
actionButton("id", "Action 1")
)
),
div(
style = "flex: 0.2; padding: 5px; background-color: pink;",
class = "pull-left",
div(
p("Sectino 2"),
actionButton("ids", "Action 2")
)
)
)
)
)
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
我还注意到色谱柱在孔板内效果不佳。特别是如果我打算切换井面板的输入部分。
更新:删除
justify-content: space-between
解决了问题。