【问题标题】:Change interactively background colour in dataTableOutput (highlight)以交互方式更改 dataTableOutput 中的背景颜色(突出显示)
【发布时间】:2014-05-31 00:53:28
【问题描述】:

我对闪亮的 R 包有疑问,目前在网上找不到任何帮助。我正在寻找一种在数据表中为背景着色的可能性,该数据表由 ui.R 中的dataTableOutput 实现。 server.R中renderDataTable中是否有option来设置dataTableOutput中一行的背景色。这应该被动地完成,所以我有索引,并且引用 data Table 中某些元素的索引应该是彩色的。

服务器.R

indices # reactive, let's say 1,5,4,3 and this is referring to the elements cat, mouse, dog, bird  
output$datatable <- renderDataTable(expr = datatable, options = list(???)) # the rows with cat, mouse, dog, bird in the column n should be coloured in a different way

(这不是一个最小的工作示例)

感谢您的帮助!

【问题讨论】:

    标签: r datatable render shiny


    【解决方案1】:

    据我所知,如果您使用默认的闪亮包附带的数据表功能,则无法更改数据表的背景颜色,或者您可以尝试一些其他自定义引导主题,而不是使用默认主题。

    最后你也可以试试rCharts包自带的datatabledTable函数。那里的背景是“蓝色和白色”,我认为这可能适合您的需要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-28
      • 2013-01-09
      • 2017-07-11
      • 1970-01-01
      • 1970-01-01
      • 2013-03-21
      相关资源
      最近更新 更多