【问题标题】:R Shiny display checkboxGroupInput horizontallyR闪亮显示checkboxGroupInput水平
【发布时间】:2014-02-24 10:38:14
【问题描述】:

如何使用 R 闪亮水平显示checkboxGroupInput(内联块)?

【问题讨论】:

    标签: r checkbox shiny


    【解决方案1】:

    你可以这样做:

    checkboxGroupInput(inputId="test", label="Test", choices=1:4),
    tags$style(type="text/css", HTML("#test>*{float: left; margin-right: 15px; height: 20px;} #test {height: 20px;}"))
    

    或者直接编辑css文件,见https://groups.google.com/forum/#!topic/shiny-discuss/EMQV8NbA3MI

    编辑

    由于shiny 0.10.0,您可以使用inline 参数进行水平布局:

    library("shiny")
    ui <- fluidPage(
      checkboxGroupInput(inputId="test", label="Test", choices=1:4, inline = TRUE)
    )
    server <- function(input, output) {
    
    }
    shinyApp(ui = ui, server = server)
    

    【讨论】:

    • 我已经使用inline 参数作为我的复选框的水平布局,但是如何将所有框都对齐?
    • @Victorp,我需要使用 checkboxGroupInput 来使用过滤器并在过滤器中显示所选变量的项目。如果您能看一看并提出建议,那将对我有很大帮助。谢谢 !!该帖子的链接是stackoverflow.com/questions/41187194/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-06
    • 2018-12-21
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    相关资源
    最近更新 更多