css - Shiny 的 tabsetPanel 中的背景颜色

标签 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。

最佳答案

wellPanel 上使用 style 选项:

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

关于css - Shiny 的 tabsetPanel 中的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24459143/

相关文章:

r - 如何防止 Shinyapp.io 每次重新发布时更改 URL

css - 使用 CSS 动画从中心显示文本并在末尾保持文本可见

html - 出现在错误列中的部分和文本之间的间隙

r - 无法处理VECSXP类型的对象?

r - 如何在 dplyr 中查找组中前 N 个降序值

javascript - 使用 javascript 时从 Shiny 的应用程序下载绘图时出错

具有动态固定中心的 jQuery SlideDown

jquery - 将魔术线宽度设置为 anchor 而不是列表项

r - 交互式和非交互式R session 的traceback()

r - 在应用程序下方的展示模式下启动 Shiny 的应用程序