I am trying to implement both [scrollable]="true" and stick header in p-table of PrimeNg. But sticky header works fine if I won't use the scrollable. If I implement both, scrollable is working but sticky header is not working.
I used the following css from primeng for the sticky header.
:host ::ng-deep .ui-table .ui-table-thead > tr > th {
position: -webkit-sticky;
position: sticky;
top: 69px;
box-shadow: 1px 3px 6px 0 rgba(32,33,36,0.10);
}
@media screen and (max-width: 64em) {
:host ::ng-deep .ui-table .ui-table-thead > tr > th {
top: 99px;
}
}
and for scrollable I used the below code, [scrollable]="true"
<p-table [columns]="cols" [value]="cars1" [scrollabe]="true">
...
<th *ngFor="let col of columns" >
If I remove [scrollable]="true"
sticky header works fine. How can I make it works both things.?
Here is the stackblitz.