First, let me showcase my code.
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> No. </th>
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
</ng-container>
Everything is functioning perfectly, but I need to display text with a fixed length. For instance, if the text is 50
characters long, I want only 40
characters to be displayed. Each row contains multiple cells of set lengths.
The issue lies in setting the width based on the text length itself. Although I've come across several examples online, most rely on defining column widths in the CSS file. How do I go about achieving this? Any help would be greatly appreciated.