将选项卡放在右侧的Shiny tabsetPanel中 [英] Place tab in Shiny tabsetPanel on the right

查看:186
本文介绍了将选项卡放在右侧的Shiny tabsetPanel中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,tabsetPanel中的选项卡位于左侧.是否可以在右侧放置一个标签,同时在左侧放置其他标签?这样看起来像这样吗?

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 looks like this?

library(shiny)

ui <- fluidPage(
  tabsetPanel(
    tabPanel("tab_left1"),
    tabPanel("tab_left2"),
    tabPanel("tab_right")
  )
)

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

shinyApp(ui, server)

推荐答案

确实应使用float-right.使用2 tabsetPanel的问题在于,同时有2个活动选项卡.

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)

这篇关于将选项卡放在右侧的Shiny tabsetPanel中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆