Search code examples
reactjsbackground-colorprimeng-datatableprimereact

PrimeReact DataTable background colour


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?


Solution

  • 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
    }