gpt4 book ai didi

css - 如何包装 checkboxGroupInput 的输出?

转载 作者:行者123 更新时间:2023-11-28 14:29:17 24 4
gpt4 key购买 nike

如何修改以下代码,使 '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)

最佳答案

如果您想选择 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)

关于css - 如何包装 checkboxGroupInput 的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54322922/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com