.。根据
this SO questionsplitLayout
应该做我想做的。
问题
这个选择输入
放入页脚时,不填充整个空格。似乎一旦在页脚选择输入
始终采用固定宽度。有趣的是,当将相同的元素放入盒体时,控件将呈现为可预见的效果。
问题
我该怎么办选择输入
以及动作按钮
- 彼此紧挨着
- 跨越整条线?
代码
library(shiny)
library(shinydashboard)
boxUI <- function(width) {
box(
splitLayout(
selectInput("x", NULL, paste(strrep("x", 10), 1:10)),
actionButton("ok", icon("trash")),
cellWidths = c("85%", "15%"),
cellArgs = list(style = "vertical-align: top")),
footer = splitLayout(
selectInput("y", NULL, paste(strrep("x", 10), 1:10)),
actionButton("ok", icon("trash")),
cellWidths = c("85%", "15%"),
cellArgs = list(style = "vertical-align: top")
), width = width, solidHeader = TRUE, status = "info", title = "Box")
}
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
tags$head(
tags$style(
HTML(".shiny-split-layout > div {
overflow: visible;
}"))),
fluidRow(
boxUI(4),
boxUI(3))
))
server <- function(input, output) {
}
shinyApp(ui, server)
![enter image description here](https://i.stack.imgur.com/jvXNa.png)