0

I'm using <p-dataTable [rowStyleClass]="rowStyler" etc>, and the method in my component looks like this:

  newRowFormat(rowData, rowIndex) {
    return('newRow');
  }

And in the component CSS, that class newRow looks like this:

:host /deep/ .newRow {
  background-color: gold;
}

The result is that every other row of the table is being colored gold, when every row should have that class applied to it. Long story, but I want the class applied to every single row, not every other row.

enter image description here

Ideas?

twosouth
  • 171
  • 3
  • 12

1 Answers1

0

Well, the solution (at least for now) turned out to be to use the forbidden !important rule:

:host /deep/ .newRow {
  background-color: gold!important;
}

Don't really like it (or understand why it works), but it works. Trying to override PrimeNG styles is requiring me to use :host /deep/ as well as !important in this case.

twosouth
  • 171
  • 3
  • 12