【问题标题】:Set top/bottom margin for tabs in shiny tabsetPanel为闪亮的 tabsetPanel 中的选项卡设置顶部/底部边距
【发布时间】:2017-04-25 06:20:48
【问题描述】:

谁能帮助使用 CSS 为 tabsetPanel 中的选项卡设置顶部/底部边距?

这是一个示例代码

library(shiny)
shinyApp(
 ui=shinyUI(
    fixedPage(
        tabsetPanel(
            tabPanel("Data Input",
                    fixedRow(
                        column(12,
                               h6("test"))
                    )
            )
        )
    )
)
,

server=shinyServer(function(input, output) {

 })

)

【问题讨论】:

    标签: css r shiny


    【解决方案1】:

    也许是这样的。欲了解更多信息,请参阅:Background color of tabs in shiny tabPanel

    library(shiny)
    shinyApp(
    ui=shinyUI(
    fixedPage(
      tabsetPanel(
        tabPanel("Data Input",
                 tags$style(HTML("
                  .tabbable > .nav > li > a {margin-top:50px;}")),
                 fixedRow(
                   column(12,
                          h6("test"))
                 )
        )
      )
    )
    )
    ,
    
    server=shinyServer(function(input, output) {
    
    })
    )
    

    【讨论】:

    • 感谢@timfaber 的回答,这很有效。我个人更喜欢 tags$head(tags$style( HTML(' .nav {margin-top:30px;}')))
    猜你喜欢
    • 2017-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 2017-04-25
    • 2015-05-16
    • 2019-12-28
    • 1970-01-01
    相关资源
    最近更新 更多