I have to change the width of column in primeNG table so How can I change it?

84 Views Asked by At

`Here I am geting data from api but column width is very large I have to change the column width Also I try this solution: Adding inlie style , Override the css. Also I have added my code below

<ng-template pTemplate="header">
<tr>
<th pSortableColumn="InvoiceId">
ID 
<p-sortIcon field="InvoiceId"></p-sortIcon>
</th>
<th pSortableColumn="invoiceno">
Invoice Number 
<p-sortIcon field="invoiceno"></p-sortIcon>
</th>
<th pSortableColumn="FullName">
Name 
<p-sortIcon field="FullName"></p-sortIcon>
</th>
1

There are 1 best solutions below

0
Shameel Perayil On

refer doc: https://primeng.org/table

You can use min-width, max-width attributes to set the column width. There is also inline style, style class, table style which you can use to set custom css to handle widths of the table.