【问题标题】:Change the font inside tags in a shiny app在闪亮的应用程序中更改标签内的字体
【发布时间】:2020-02-14 20:24:56
【问题描述】:

如何在闪亮的应用程序中设置文本中的字体?我应该为每个tags$ 更改它还是有通用的方法?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(

  ),
  dashboardBody(

  )
)

server <- function(input, output) { 
  tags$h3(style="color:black","font-family:Calibri", "Text")
  }

shinyApp(ui, server)

这是我要编辑的部分的示例:

output$tabers<-renderUI({
    if(input$sec=="Introduction"){
      tabsetPanel(id="I",type="tabs",tabPanel("Start", id = "StartHR",
                           tags$br(),
                           img(src='Alpha-Architect.png', align = "center",height="100%", width="50%"),


                           tags$br(),
                           tags$br(),

                           tags$h3(style="color:black", "About this Dashboard"),
                           br(),

                           p(style="text-align:justify; color:black;'",'Produced by',a("Alpha Architect.", 
                                                                                      href = "https://alphaarchitect.com"),"and",a("RStudio.", 
                                                                                                                                   href = "http://www.reproduciblefinance.com/")),
                           #br(),
                           br(),
                           p(style="text-align:justify; color:black;'",'Please read our full disclosures',a("here", 
                                                                                                            href = "https://alphaarchitect.com/disclosures")),

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    为什么要写在服务器上?

    要全局应用样式,您需要在 HTML 头部添加样式。

    将此添加为您的仪表板正文:

    dashboardBody(
        tags$head(
            tags$style("h3 {font-family:Calibri}")
        )
    )
    

    【讨论】:

    • 我是在服务器上写的,因为文本在 renderUI 中
    猜你喜欢
    • 1970-01-01
    • 2016-11-02
    • 2017-06-04
    • 2021-10-30
    • 1970-01-01
    • 2021-07-20
    • 1970-01-01
    • 1970-01-01
    • 2015-11-19
    相关资源
    最近更新 更多