Table columns auto fit the the content width

UI Components for Angular
Post Reply
Arudian
Posts: 2
Joined: 02 Oct 2019, 13:47

07 Oct 2019, 13:18

Hi,

Just as in the title, I am wondering if there is some kind of autofit feature for tables. I would like to have column width match the content, and not use predefined width for all columns.

artem.nikitin
Posts: 2
Joined: 06 Oct 2019, 17:43

09 Oct 2019, 22:13

Hi,

You can start with autoLayout set to true, because primeng's table has fixed table-layout by default. Table width is 100% by default so it may be enough for your case

Code: Select all

<p-table [columns]="cols" [value]="rows" [autoLayout]="true">

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests