大家好,如何在tabItem中为一个框更改闪亮仪表板中的字体系列?
我已经在dashboardBody中包含了一些css编码,更改了颜色和字体系列,但这只链接到主标题:
我已经在dashboardBody中包含了一些css编码,更改了颜色和字体系列,但这只链接到主标题:
body <- dashboardBody( tags$head(tags$style(HTML(' .skin-blue .main-header .logo { font-family: "Calibri"; font-weight: bold; font-size: 28px; background-color: #003D76; } .skin-blue .main-header .navbar { background-color: #0082D1; } '))),
非常感谢帮助.
tabItem具有以下开头:
tabItems( tabItem(tabName = "dashboard",fluidRow( box( title = strong("GPIM Liquidity Risk"),status = "primary",solidHeader = TRUE,width = 8,img(src = "gpim-signet.png",height = 80,width = 130),
谢谢!
解决方法
您可以像这样更改主侧边栏的CSS(我提供了一些选项以方便您)
可重复的示例如下(它是默认皮肤,所以如果你使用其他皮肤 – 你应该将肤色变为其他东西):
library(shiny) library(shinydashboard) ## ui ui <- dashboardPage( dashboardHeader(title="MPG Data"),dashboardSidebar( sidebarMenu( menuItem("MPG",tabName="mpg") ) ),dashboardBody( #here's where you throw the css into the header tags$head( includeCSS(path = "www/style.css") ),tabItems( tabItem(tabName="mpg",fluidRow(tableOutput("mpgTable")) ) ) ) ) ## server server <- function(input,output) { output$mpgTable <- renderTable({mpg}) } ## launch dashboard shinyApp(ui,server)
css文件的内容如下
/* main sidebar */ .skin-blue .main-sidebar { background-color: #f4b943; font-family: "Calibri"; font-size:25px; line-height:1.42857143; color:#ebebeb; }
希望它会有所帮助!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。