在R Shiny的1行上设置tabPanel

时间:2019-12-10 17:24:55

标签: css r shiny

我在固定创建的tabPanel上的选项卡时遇到麻烦,这些选项卡全部排成一行。忽略黑框,它是在我尝试编辑图片时发生的。 enter image description here

当我展开页面时,它们都适合。因此,我确实认为固定宽度可以解决此问题。或通过删除周围的空白区域。似乎没有什么可以解决这个问题的,所以我没有做太多尝试。

shinyUI(fluidPage(theme='stylepage.css',
    # Application title
    titlePanel(title=div(img(src='My_Logo.png',width='500px',height='200px'), align='center')),
    mainPanel(
        # Output: Tabset w/ headers ---
        tabsetPanel(type = 'tabs',
                    tabPanel('Section 1'), 
                    tabPanel('Section and Other 2'),
                    tabPanel('Section 3'),
                    tabPanel('Section and Other 4'),
                    tabPanel('Section and Other 5'),
    )
))

1 个答案:

答案 0 :(得分:1)

该错误是由于将您的tabsetPanel包装在mainPanel中引起的;尝试删除周围的mainPanel(例如see here)。

或者,您可以在mainPanel中增加width参数。参见?mainPanel