将闪亮的小部件放在标题旁边

geo*_*ory 5 r shiny

我如何定位selectInput()除了标题之外的Shiny小部件(例如下拉框)?我一直在玩各种tags配方而没有任何运气.感谢任何指针.

ui.R

library(shiny)  
pageWithSidebar( 
  headerPanel("side-by-side"), 
  sidebarPanel(
tags$head(
  tags$style(type="text/css", ".control-label {display: inline-block;}"),
  tags$style(type="text/css", "#options { display: inline-block; }"),
  tags$style(type="text/css", "select { display: inline-block; }")
),
selectInput(inputId = "options", label = "dropdown dox:", 
  choices = list(a = 0, b = 1))
  ),
  mainPanel( 
    h3("bla bla")
  )
)
Run Code Online (Sandbox Code Playgroud)

server.R

shinyServer(function(input, output) { NULL })
Run Code Online (Sandbox Code Playgroud)

jdh*_*son 6

这是你想要的吗?

library(shiny)  

runApp(list(ui = pageWithSidebar( 
  headerPanel("side-by-side"), 
  sidebarPanel(
    tags$head(
      tags$style(type="text/css", "label.control-label, .selectize-control.single{ display: inline-block!important; }")
    ),
    selectInput(inputId = "options", label = "dropdown dox:", 
                choices = list(a = 0, b = 1))
  ),
  mainPanel( 
    h3("bla bla")
  )
)
, server = function(input, output) { NULL })
)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述