如何修改以下代码,以使'checkboxGroupInput'选项包含在'width:200px'中?
library(shiny)
ui <- fluidPage(
tags$style("
.custom-wrap {
display: flex;
flex-flow: wrap;
flex-direction: column;
width: 200px;
}
"
),
div(class = "custom-wrap",checkboxGroupInput("variable", "Variables to show:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear")))
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
答案 0 :(得分:1)
如果要选择checkboxGroupInput
的所有子代,请使用此选择器#variable *
:
library(shiny)
ui <- fluidPage(
tags$style("
#variable * {
display: flex;
flex-flow: wrap;
flex-direction: column;
width: 200px;
}
"
),
checkboxGroupInput("variable", "Variables to show:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear")))
server <- function(input, output, session) {
}
shinyApp(ui, server)