首页 > 解决方案 > 在 renderTable 中自定义标题并使其具有反应性 R Shiny

问题描述

当我使用 paste0() 添加反应值时,它告诉我我正在尝试做一些只能在反应环境中完成的事情。有人可以告诉我如何使标题反应吗?

这段代码在 renderTable 中给出了一个小标题。如何自定义颜色、大小、字体、中心?谢谢!

shinyApp(
  ui = fluidPage(
    fluidRow(
      column(12,
             tableOutput('table')
      )
    )
  ),
  server = function(input, output) {
    output$table <- renderTable(iris, striped = TRUE, bordered = TRUE, hover = TRUE, spacing = 'm',  
                                width = '75%', align = 'c', rownames = TRUE,  digits = 5,
                                caption = "Iris",
                                caption.placement = getOption("xtable.caption.placement", "top"))
  }
)
}

标签: rshinyshiny-servershiny-reactivity

解决方案


推荐阅读