primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.15k stars 4.54k forks source link

Table columns change size if other columns are resized (expand mode) #13214

Open micw opened 1 year ago

micw commented 1 year ago

Describe the bug

On a table with expand mode, when I change the size of a table column, other columns change their size too (very good visible if you resize the 2nd column - then the 1st column and probably the others too increase the size slightly).

Environment

Angular and PrimeNG 15. Also reproducible on the latest demo page (including Primeng 16)

Reproducer

https://primeng.org/table#expand-mode

Angular version

15

PrimeNG version

15.4.3 TLS, also in 16.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v20.3.0

Browser(s)

Firefox

Steps to reproduce the behavior

  1. Go to https://primeng.org/table#expand-mode
  2. Increase or decrease the size of the column "Name"
  3. Watch the size of the column "Code" - it changes

Expected behavior

Code should not alter it's size since it's not touched by the user

micw commented 1 year ago

Possibly the same (but closed without a fix): https://github.com/primefaces/primeng/issues/11186

nicholas-ochoa commented 1 year ago

@micw I submitted a pull a few months ago with a fix for this, but it has not been accepted. #12529

damianpolak commented 1 year ago

I've got this same bug. I'm still waiting for fix...

sriteja2602 commented 7 months ago

Hi! This is fixed in v16 and above.

NynaPykulska commented 6 months ago

OP mentioned that it still happens in v16. I am also experiencing this problem in 16.9.1. To me, it happens for a table with a footer. When I remove the footer, resize works as expected.

Ï found a hack to make it work with the footer - you need to skip the <tr> inside <ng-template pTemplate="footer">, and write the <td> tags directly in there, and then override the styles with

.p-datatable-tfoot {
            display: table-row;
}