【发布时间】:2021-02-09 09:39:54
【问题描述】:
当我在 R 中执行以下代码时,它运行良好。
example<- reactable(data.frame(country=c("argentina","brazil"),
value=c(1,2)
))
withtitle <- htmlwidgets::prependContent(example,
h2(class = "title", "Top CRAN Packages of 2019"))
print(withtitle)
但是,当我使用闪亮的方式执行相同的代码时
reactableOutput("table_1")
和
output$table_1 <- renderReactable({
example<- reactable(data.frame(country=c("argentina","brazil"),
value=c(1,2)
))
withtitle <- htmlwidgets::prependContent(example,
h2(class = "title", "Top CRAN Packages of 2019"))
print(withtitle)
})
报错:
renderWidget(instance) 中的警告:忽略前置内容; prependContent 不能在 Shiny 渲染调用中使用
请指导我为上表指定标题以及标题的背景颜色、字体颜色等其他参数。
【问题讨论】: