如何在 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()
))
为了更清楚,请看下面的图片:
不同之处在于任何 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)) })
}
))
关于css - Shiny 的 tabsetPanel 中的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24459143/