在闪亮的应用程序中将两个操作按钮放在一起

时间:2017-07-08 21:51:33

标签: css r shiny

我正在尝试在侧边栏的Shiny应用中放置两个操作按钮。这是可能吗?如果我能保持简单,我不想诉诸于使用专栏

ui.R:
fluidPage(
 # Application title
 titlePanel("Place Two Buttons"),

 sidebarLayout(
# Sidebar with a slider and selection inputs
sidebarPanel(

  actionButton("read", "Change"),
  hr(),
  actionButton("write", "Change") 
),


mainPanel(
  plotOutput("plot")
  )
)
)

和我的服务器:

server.R:
function(input, output, session) {

}

到目前为止,我发现的所有内容都是使用css表达式或使用Bootstrappage。有帮助吗?

1 个答案:

答案 0 :(得分:0)

您可以删除hr()以并排显示两个按钮:

ui <- fluidPage(
  # Application title
  titlePanel("Place Two Buttons"),

  sidebarLayout(
    # Sidebar with a slider and selection inputs
    sidebarPanel(
      actionButton("read", "Change"),
      actionButton("write", "Change") 
    ),

    mainPanel(
      plotOutput("plot")
    )
  )
)

server <- function(input, output, session) {}
shinyApp( ui = ui, server = server )

这给出了这个:

enter image description here