ssuperczynski / ngx-easy-table

The Easiest Angular Table. 12kb gzipped! Tree-shakeable. 55 features and growing!
https://ngx-easy-table.eu
MIT License
371 stars 101 forks source link

How to add a sticky header without virtual scroll and with pagination #384

Closed muhammed671 closed 1 year ago

muhammed671 commented 2 years ago

Hello,

How I can change the header to sticky header with this configuration?

this.configuration = { ...DefaultConfig };
this.configuration.searchEnabled = true;
this.configuration.horizontalScroll = true;
this.configuration.tableLayout.style = 'tiny';
this.configuration.checkboxes = true;

HTML

<ngx-table
  [configuration]="configuration"
  [data]="this.data"
  #table
  [detailsTemplate]="detailsTemplate"
  [columns]="columns"
  (event)="eventEmitted($event)"
>
<ng-template let-row let-index="index">
   ...
</ng-template>
</ngx-table>
<ng-template #detailsTemplate let-row>
  ...
</ng-template>

I tried already this here in my scss file:

:host ::ng-deep #table {
    font-family: 'Montserrat', sans-serif;
    .ngx-table__header{
      position: -webkit-sticky;
      position: sticky;
      top: 0;
      z-index: 9999;
    }
}

But it's not working.

ssuperczynski commented 1 year ago
:host ::ng-deep thead {
    position: sticky;
    top: 0;
    background-color: white;
}