繁体   English   中英

R Shiny:中心标签集面板标签

[英]R Shiny: center tabsetPanel labels

如何将tabsetPanel中可见的标签居中? 当前,我使用renderUI定义选项卡:

output$uiTabs <- renderUI({
tabsetPanel(tabPanel("visualization1",tableOutput("table1")),
            tabPanel("visualization2",tableOutput("table2"))) })

然后在用户界面中,我会看到以下内容:

    column(8,align="center",
           uiOutput("uiTabs"))

现在,表格已居中对齐,但选项卡本身未对齐。

这就是我们在OP的评论部分中讨论的内容

#tabsetPanel holds all of the tabs

tabsetPanel( 

#create an empty tab with white text being the label
#Inserting more text will increase the width of the label

            tabPanel(tags$div( 

              HTML(paste(tags$span(style="color:white", "TYPE A LONG STRING HERE TO SPACE ACCORDINGLY"), sep = "")) 

             )), 

#Other tabpanels

            tabPanel("visualization1",tableOutput("table1")), 

            tabPanel("visualization2",tableOutput("table2")), 

#Make sure to keep the selected = "tabPanel id" here because 
#it will default select the empty panel 

selected = "visualization1")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM