Place tab in Shiny tabsetPanel on the right

后端 未结 3 984
夕颜
夕颜 2021-01-20 16:49

By default tabs in a tabsetPanel are put on the left. Is it possible to place a tab on the right side, while still having other tabs on the left? So that it loo

3条回答
  •  隐瞒了意图╮
    2021-01-20 17:47

    Using float-right should indeed work. The problem with using 2 tabsetPanel is that there are 2 active tabs at the same time.

    library(shiny)
    
    ui <- fluidPage(
      tags$head(
        tags$style(HTML(
          ".tabbable ul li:nth-child(3) { float: right; }"
        ))
      ),
      tabsetPanel(
        tabPanel("tab_left1"),
        tabPanel("tab_left2"),
        tabPanel("tab_right")
      )
    )
    
    server <- function(input, output, session) {}
    
    shinyApp(ui, server)
    

提交回复
热议问题