【发布时间】:2018-03-12 13:32:33
【问题描述】:
我使用Adjust height of the whole header bar in dashboardHeader in shiny dashboard 的答案使我的dashboardHeader 更小。当我使浏览器窗口变小时,标题会被包装,但“测试”输出没有被调整。
我在dashboardBody 中添加了一个tags$style(".content-wrapper {padding-top: 12px}"),它提供了更多空间,但我要么不希望对标头进行换行,要么对输出的位置进行调整。
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(
# Set height of dashboardHeader
tags$li(class = "dropdown",
tags$style(".main-header {max-height: 20px}"),
tags$style(".main-header .logo {height: 20px;}"),
tags$style(".sidebar-toggle {height: 20px; padding-top: 1px !important;}"),
tags$style(".navbar {min-height:20px !important}")
)
),
dashboardSidebar(
# Adjust the sidebar
tags$style(".left-side, .main-sidebar {padding-top: 20px}")
),
dashboardBody(
tags$style(".content-wrapper {padding-top: 12px}"),
verbatimTextOutput('test')
)
)
server <- function(input, output){
output$test <- renderText('Test')
}
shinyApp(ui, server)
【问题讨论】:
标签: r shiny shinydashboard