Am using PrimeReact DataTable in my React application.I have a requirement to change the background colour from white to grey in the DataTable..I tried custom style in the component. But not working.. Can you please help me?
Asked
Active
Viewed 1,108 times
0

Jasper de Vries
- 19,370
- 6
- 64
- 102

vivek v
- 167
- 1
- 3
- 16
-
do you want for the whole datatable to be in grey? – Apostolos Jun 23 '21 at 13:56
1 Answers
1
If you want to override the style of the Datatable
then use this css
.p-datatable-tbody tr {
background: gray !important;
}
or, in order to avoid !important
.p-datatable .p-datatable-tbody > tr {
background: gray
}

Apostolos
- 10,033
- 5
- 24
- 39
-
Its working ... I added .p-datatable-header and .p-datatable .p-datatable-thead > tr > th – vivek v Jun 23 '21 at 14:50