Change color of even and odd row

UI Components for React
Post Reply
Posts: 2
Joined: 06 Jul 2020, 16:37

06 Jul 2020, 16:42

Hello, I am trying to change to alternating colors for even and odd rows as I find the default to not have enough contrast. I searched around but could not find a working solution.

Here is the code that I am currently trying:

Code: Select all

.p-datatable.p-datatable-odd {
    background-image: none;

.p-datatable.p-datatable-even {
    background-image: none;
Any help is appreciated.

Posts: 4638
Joined: 29 Jun 2013, 12:38

11 Oct 2020, 00:39


Please see our striped demo; ... le/striped
To customize the colors;

Code: Select all

.p-datatable.p-datatable-striped .p-datatable-tbody > tr:nth-child(even) {
    background: #fcfcfc;

.p-datatable .p-datatable-tbody > tr {
    background: #ffffff;
Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: Sevket and 0 guests