How to hide/remove checkbox from p-table header

2.6k views Asked by At

I used primeng p-table for multiple selection grid. I have requirement to select multiple row by clicking on each row checkbox. I have to hide/remove checkbox from ptable header.

Can I get solution for this. I have tried changing css styles but couldn't able to hide checkbox in header of ptable. thanks in advance.

2

There are 2 answers

1
Carsten On

For adding and removing elements, Angular has the *ngIf="" directive.

Edit: When scrolling through the documentation (here), i read that the column has a hidden property. Use that.

hidden  boolean false   Controls visiblity of the column.
0
MANISH PARGANIHA On

The best way to remove "Checkbox" from header is through styles.

Check the dom tree for style hierarchy and as per your code modify below code to suits your hierarchy. Typical hierarchy as below.

th.p-selection-column .p-checkbox {
    display: none;
}