【问题标题】:R shiny align 100 radioGroupButtons 10x10R闪亮对齐100 radioGroupButtons 10x10
【发布时间】:2020-07-17 08:59:40
【问题描述】:

我有以下示例,它呈现 100 个反应式单选按钮。

library(shiny)
library(shinyWidgets)    
if (interactive()) {
  
  ui <- fluidPage(
    tags$h1("radioGroupButtons examples"),
    
    radioGroupButtons(
      individual = T, selected = "",status = "danger",
      inputId = "somevalue1",
      label = "Make a choice: ",
      choices = rep("x", 100)
    ),
    verbatimTextOutput("value1"),
  )
  server <- function(input, output) {
    
    output$value1 <- renderPrint({ input$somevalue1 })
    
  }
  shinyApp(ui, server)
  
}

我现在想在 10 列 x 10 行中排列/对齐按钮,但我无法确定我应该针对哪个 CSS 类来执行此操作。

【问题讨论】:

    标签: css r shiny alignment


    【解决方案1】:

    您可以使用 CSS flexbox 或网格

    弹性盒示例:

    #content {
        display: flex;
        flex-wrap: wrap;
        width: 250px;
    }
    
    #content>input {
        width: 25px;
        height: 25px;
    }
    

    网格示例:

    #content {
        display: grid;
        grid-template-columns: repeat(10, 1fr);
    }
    

    【讨论】:

      猜你喜欢
      • 2015-04-29
      • 2014-06-30
      • 2015-04-26
      • 2015-04-19
      • 2016-06-05
      • 2021-04-28
      • 2021-03-11
      • 2015-05-11
      • 1970-01-01
      相关资源
      最近更新 更多