Search code examples
htmlangularfrontendprimengprimeng-datatable

primeng p-table checkbox and filter


please i dont know how to fix this. The table filter is not aligning with the table header

Hello everyone! i am using p-table, p-headercheckbox, p-tableCheckbox and additional filter for each column. The problem is that filters are not aligning with headers.


Solution

  • You should include an empty <th></th> before the rest of the filters to take the place of the checkbox column.

    <tr>
      <th></th>
      <th *ngFor="let col of columns" [ngSwitch]="col.field">
        ...
      </th>
    </tr>