Positioning Shiny widgets beside their headers

前端 未结 1 1109
挽巷
挽巷 2020-12-18 08:20

How can I position Shiny widgets (e.g. the dropdown box of selectInput()) besides their headers? I\'ve been playing around with various tags formu

相关标签:
1条回答
  • 2020-12-18 08:50

    Is this what you want?

    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 })
    )
    

    enter image description here

    0 讨论(0)
提交回复
热议问题