r 数据表 (DT) 边框宽度/颜色

问题描述 投票:0回答:2

给定表格

library(DT)

datatable(
  iris,
  style = "default",
  filter = "top",
  class = "hover stripe compact"
)

我可以使用以下CSS调整页脚边框

table.dataTable.no-footer {
    border-bottom: 1px solid #ddd;
}

但是我似乎无法理解如何更改列名称下的边框,以及正文第一行上方的边框。这怎么办?

css r datatables dt
2个回答
1
投票

以下 css 就成功了:

table.dataTable thead th, table.dataTable thead td {
    border-bottom: 1px solid #ddd;
}

0
投票

@aleksip:使用您提供的规则,样式将不会应用于 td 单元格,因为它们位于 tbody 下,而不是 thead 下。我认为您的意图如下。

table.dataTable.no-footer thead th,
table.dataTable.no-footer tbody td
{
  border-bottom: 1px solid #ddd;
}
© www.soinside.com 2019 - 2024. All rights reserved.