9

I'm using ngx-datatable with the bootstrap theme. I can't find or figure out how to change the styling for when the mouse is hovered over a cells?. In this example it goes grey

http://swimlane.github.io/ngx-datatable/#css

I've been able to change the activation colour like this, just can't figure out the hover colour.

::ng-deep .ngx-datatable.bootstrap .datatable-body .datatable-body-
row.active {
  background-color: #006eff;
  color: #FFF;
}
Joel
  • 5,732
  • 4
  • 37
  • 65
Tim Tharratt
  • 1,251
  • 1
  • 10
  • 18

2 Answers2

15
.ngx-datatable.bootstrap:not(.cell-selection) .datatable-body-row:hover,
.ngx-datatable.material:not(.cell-selection) .datatable-body-row:hover .datatable-row-group
{ 
   background: red;
}

This works.

Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
C.Schubert
  • 2,034
  • 16
  • 20
3
 :host
  ::ng-deep
  .ngx-datatable.bootstrap:not(.cell-selection)
  .datatable-body-row:hover,
:host
  ::ng-deep
  .ngx-datatable.material:not(.cell-selection)
  .datatable-body-row:hover
  .datatable-row-group {
  background: red;
}

I had to add

    :host
  ::ng-deep

and then it stared working.

You can change other default styles because there is a linear translation:

:host
  ::ng-deep
  .ngx-datatable.material:not(.cell-selection)
  .datatable-body-row:hover {
  background-color: #007bff2e;
}
BartusZak
  • 1,041
  • 14
  • 21
  • how can i apply similar for selected ? the example they have for selected does not work fo rme ! – kuldeep Oct 26 '20 at 15:42