如何在闪亮的 R 中将 SelectInput 向左对齐而没有多余的空格

How to align SelectInput to left without extra spaces in shiny R

我有这个闪亮的应用程序:

if (interactive()) {
  shinyApp(
    ui = fluidPage(
      selectInput("variable", "Variable:",
                  c("Cylinders" = "cyl",
                    "Transmission" = "am",
                    "Gears" = "gear")),
      tableOutput("data")
    ),
    server = function(input, output) {
      output$data <- renderTable({
        mtcars[, c("mpg", input$variable), drop = FALSE]
      }, rownames = TRUE)
    }
  )
   shinyApp(
    ui =            fluidPage(
      tags$style(type='text/css', ".selectize-input { font-size: 10px; line-height: 10px;} .selectize-dropdown { font-size: 10px; line-height: 10px; }"),
      column(1,align="center"),
      column(2,align="center",selectInput(width= "150px", "eshkol",h6("x"),c("q","a","c","x"))),
      column(2,align="center",selectInput(width= "170px", "eshkol2",h6("y"),c("q","a","c","x"))),
      column(2,align="center",selectInput(width= "1100px", "eshkol3",h6("z"),c("q","a","c","x"))),
      column(1,align="center",selectInput(width= "80px", "eshkol4",h6("s"),c("q","a","c","x"))),
      column(1,align="center",selectInput(width= "120px", "eshkol5",h6("t"),c("q","a","c","x"))),
      column(1,align="center",selectInput(width= "120px", "eshkol6",h6("q"),c("q","a","c","x"))),

      
    )
        ,
    server = function(input, output) {
      output$result <- renderText({
        paste("You chose", input$state)
      })
    }
  )
}

我想重新排序 SelectInput - 删除 SelectInput 之间的多余空格并将其左对齐。我想保持我在代码中写的宽度。

欢迎任何建议

1 个想法但未应用任何 css :

将第一个两个输入的列宽更改为 1 并按需要工作:

column(1,align="center",selectInput(width= "150px", "eshkol",h6("x"),c("q","a","c","x"))),
    column(1,align="center",selectInput(width= "170px", "eshkol2",h6("y"),c("q","a","c","x"))),
    column(2,align="center",selectInput(width= "1100px", "eshkol3",h6("z"),c("q","a","c","x"))),
    column(1,align="center",selectInput(width= "80px", "eshkol4",h6("s"),c("q","a","c","x"))),
    column(1,align="center",selectInput(width= "120px", "eshkol5",h6("t"),c("q","a","c","x"))),
    column(1,align="center",selectInput(width= "120px", "eshkol6",h6("q"),c("q","a","c","x")))),

输出 - 与您显示的相同 - 为我工作