2

Can anyone help with setting the top/bottom margin for the tabs in a tabsetPanel in shiny using CSS?

Here's an example code

library(shiny)
shinyApp(
 ui=shinyUI(
    fixedPage(
        tabsetPanel(
            tabPanel("Data Input",
                    fixedRow(
                        column(12,
                               h6("test"))
                    )
            )
        )
    )
)
,

server=shinyServer(function(input, output) {

 })

)

enter image description here

ChriiSchee
  • 667
  • 1
  • 8
  • 20

1 Answers1

4

Maybe something like this. For more info see: Background color of tabs in shiny tabPanel

library(shiny)
shinyApp(
ui=shinyUI(
fixedPage(
  tabsetPanel(
    tabPanel("Data Input",
             tags$style(HTML("
              .tabbable > .nav > li > a {margin-top:50px;}")),
             fixedRow(
               column(12,
                      h6("test"))
             )
    )
  )
)
)
,

server=shinyServer(function(input, output) {

})
)
Community
  • 1
  • 1
timfaber
  • 2,060
  • 1
  • 15
  • 17
  • 3
    Thank you for the answer @timfaber, that works. I personally prefer tags$head(tags$style( HTML(' .nav {margin-top:30px;}'))) – ChriiSchee Jun 07 '17 at 08:53