我有這個閃亮的應用程式:
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 之間的多余空格并將其左對齊。我想保持我在代碼中寫的寬度。

歡迎任何建議
uj5u.com熱心網友回復:
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")))),
輸出-與您顯示的相同-為我作業

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/450193.html
上一篇:如何使用R計算三年滾動回報
