如何使 numericInput 和 selectInput 彼此相邻

How do make numericInput and selectInput next to each other

如何使 numericInputselectInput 彼此相邻而不是彼此下方?有可能吗?

下面的可执行代码:

library(shiny)

ui <- fluidPage(

    column(4,
           
         wellPanel(
           numericInput("weight1", label = h4("Weight 1"), min = 0, max = 1, value = NA, step = 0.1),
           
           selectInput("maxmin", label = h5("Maximize or Minimize"),choices = list("Maximize " = 1, "Minimize" = 2), 
                       selected = ""))),

  hr(),
  
  column(8,
         tabsetPanel(tabPanel("table1", DTOutput('table1')))))

server <- function(input, output, session) {

}

shinyApp(ui = ui, server = server)

splitLayout可以用来分割space.

wellPanel(
   splitLayout(
       numericInput("weight1", label = h4("Weight 1"), min = 0, max = 1, value = NA, step = 0.1),
       selectInput("maxmin", label = h4("Maximize or Minimize"),choices = list("Maximize " = 1, "Minimize" = 2), 
                         selected = "")))

以上代码将生成大小相同的输入,但有一个可选参数 cellWidths,如果需要另一个比率,可用于指定宽度。例如,添加 cellWidths = c("40%", "60%") 将使 weight1 占可用 space 的 40%,而 maxmin 占剩余的 60%。