tabsetPanel中的背景颜色在闪亮

时间:2014-06-27 19:04:40

标签: css r shiny

如何在tabsetPanel中获得白色背景。为了更好地理解我的问题,我将提出一个例子:

在我的ui.R文件中,我有以下内容:

mainPanel( wellPanel(wellPanel(plotOutput("densityPlot", height="500px"))), 
                               wellPanel(tabsetPanel(type = "tabs", 

        tabPanel(h5("Text1"),p("Text" )),
        tabPanel(h5("Text2"), p("Text") ),                   
        tabPanel(h5("Text3"), p("Text"))),
        br(),
        br(),
        br()                           
    ))

为了更清楚,请查看下图: enter image description here

区别在于任何tagPanel内部的白色背景区域。这种灰色和白色的组合是个问题。有谁有想法,我怎么能得到这样的tagPanals。

1 个答案:

答案 0 :(得分:7)

使用style上的wellPanel选项:

runApp(list(
  ui = fluidPage(
    titlePanel("Hello Shiny!"),
    sidebarLayout(
      sidebarPanel(
        numericInput('n', 'Number of obs', 100)
      ),
      mainPanel( wellPanel(wellPanel(plotOutput("densityPlot", height="500px"))), 
                 wellPanel(style = "background-color: #ffffff;", tabsetPanel(type = "tabs", 

                                       tabPanel(h5("Text1"),p("Text" )),
                                       tabPanel(h5("Text2"), p("Text") ),                   
                                       tabPanel(h5("Text3"), p("Text"))),
                           br(),br(),br()                           
                 ))
    )
  )
  ,
  server = function(input, output) {
    output$densityPlot <- renderPlot({ hist(runif(input$n)) })
  }
))

enter image description here