【问题标题】:PrimeReact DataTable background colourPrimeReact 数据表背景颜色
【发布时间】:2021-09-07 01:32:51
【问题描述】:

我在我的 React 应用程序中使用 PrimeReact DataTable。我需要将 DataTable 中的背景颜色从白色更改为灰色。我在组件中尝试了自定义样式。但不工作.. 你能帮帮我吗?

【问题讨论】:

  • 你想让整个数据表变成灰色吗?

标签: reactjs background-color primeng-datatable primereact


【解决方案1】:

如果你想覆盖 Datatable 的样式,那么使用这个 css

.p-datatable-tbody tr {
  background: gray !important;
}

或者,为了避免!important

.p-datatable .p-datatable-tbody > tr {
  background: gray
}

【讨论】:

  • 它的工作...我添加了 .p-datatable-header 和 .p-datatable .p-datatable-thead > tr > th
猜你喜欢
  • 2014-09-19
  • 2021-05-17
  • 2017-12-28
  • 2020-10-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-30
  • 2021-10-25
  • 2019-12-23
相关资源
最近更新 更多