【问题标题】:Shiny - how to coloring border cell table in ShinyShiny - 如何在 Shiny 中为边框单元格表着色
【发布时间】:2016-05-06 12:49:54
【问题描述】:

我有一张简单的桌子,想以闪亮的方式显示。但在默认设置中,边框单元格是透明的。这是代码...

output$tabel <-renderUI({
tabel1 <- matrix(c(1,2,3,4,5,6),2,3)
list(
renderTable(tabel1)
)
})

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    Shiny 只是 R 将 R 代码输出为 HTML 代码的包装器。您必须准确确定创建表的类,但检查here 表明它应该是shiny-html-output,然后您应该在其中有一个&lt;table&gt;。应该有一个shiny-table-output 的类,但我没有找到证明。

    但是,当您发现这一点时,您只需向您的 R 中添加一个样式表。在该样式表中您将完成您的 CSS。

    如果它是shiny-html-outputshiny-table-output,它会很简单:

    .shiny-html-output .shiny-table-output{ border: 1px solid #000; }
    

    如果它只是 shiny-html-outputtable,那么上面的内容相同,但改为 .shiny-html-output table

    就是这样。当你启动它们时,请尝试使用开发人员工具来检查浏览器的元素。大多数浏览器中的 F12 或右键单击检查是您所要做的。

    【讨论】:

      猜你喜欢
      • 2017-02-03
      • 2021-05-10
      • 2017-03-25
      • 2020-06-24
      • 2018-11-27
      • 1970-01-01
      • 1970-01-01
      • 2017-12-02
      • 1970-01-01
      相关资源
      最近更新 更多