0

I used to be able to add style="width: 25%" to the th elements in the template of the primeng table. However, it appears that this no longer works and their documentation states that autolayout is now deprecated and the table's layout is always auto. This is making my table look absolutely awful and unaligned. Is there any way around this? I've tried adding style classes to the th elements manually but this hasn't worked. https://i.stack.imgur.com/sAnjl.png

steveg234
  • 16
  • 1
  • 2

1 Answers1

1

I on my case I can still assign a specific width to 'th' elements and it works (primeng v15.2.0).

What happens to me is that for columns where I don't specify the width, prime calculate it and uses it based on the content of cells. It sounds great, but I have a paginator and every time I go to a different page it move columns from the original position.

Anyways, I just noticed they remove a css rule they had before:

.p-datatable table{
    table-layout: fixed;
}

I put it back on my own styles and it fixed my problem.