问题描述
我在我的 React 应用程序中使用 PrimeReact DataTable。我需要将 DataTable 中的背景颜色从白色更改为灰色。我在组件中尝试了自定义样式。但不工作.. 你能帮我吗?
解决方法
如果要覆盖 Datatable
的样式,请使用此 css
.p-datatable-tbody tr {
background: gray !important;
}
或者,为了避免!important
.p-datatable .p-datatable-tbody > tr {
background: gray
}