簡體   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