首页 > 解决方案 > 从具有多行闪亮的模态中更改文本的字体大小

问题描述

我想在我的模式窗口中显示一些摘要报告,它有多行。如何更改文本的字体?

shinyApp(
ui = basicPage(
  actionButton("show", "Show modal dialog")
),
server = function(input, output) {
  observeEvent(input$show, {
    str1 = paste('iris data frame has ', nrow(iris), 'rows')
    str2 = paste('cars data frame has ', nrow(cars), 'rows')
    showModal(modalDialog(
      title = "Important message",
     renderUI(HTML(paste(str1, str2, sep = '<br/>')))
    ))
  })
}
)

标签: rshiny

解决方案


一个潜在可能:

library(shiny)
shinyApp(
  ui = basicPage(
    actionButton("show", "Show modal dialog")
  ),
  server = function(input, output) {
    observeEvent(input$show, {
      str1 = tags$span(
        paste('iris data frame has ', nrow(iris), 'rows'),
        style = "font-size: 25px;"
      )
      str2 = tags$span(
        paste('cars data frame has ', nrow(cars), 'rows'),
        style = "font-size: 25px"
      )
      showModal(modalDialog(
        title = "Important message",
        tagList(str1, br(), str2)
      ))
    })
  }
)

推荐阅读