0
votes

I am using PrimeNg to edit data table.

How to set Auto width column or bring down the text next line for below sample.

You can reproduce same behavior in below primeNg link.

https://primefaces.org/primeng/showcase/#/table/edit

<td pEditableColumn>
                    <p-cellEditor>
                        <ng-template pTemplate="input">
                            <input pInputText type="text" [(ngModel)]="product.name" required>
                        </ng-template>
                        <ng-template pTemplate="output">
                            {{product.name}}
                        </ng-template>
                    </p-cellEditor>
                </td>

enter image description here

1

1 Answers

0
votes

To bring down the text next line, you have to add in the css, the next line:

td {
     word-break: break-word;
}

To see more options about word-break, I write the next link from PrimeNG