scrollable p-table column width when using colspan

UI Components for Angular
Post Reply
Space
Posts: 12
Joined: 23 May 2017, 22:51

21 Feb 2019, 00:49

Hi,

Here's an example:
https://stackblitz.com/edit/github-5vfjwy

I'm wondering how, if it's possible, to specify column width when using column groups (colspan). The example I linked above shows a use-case.

I can set the width of the columns in the scrollable table body, but the headers (which I see are a separate table element) always have an even split of width for columns as long as there is another column that is spanning.

I can see that the first example would work if the table were not set to fixed layout, but the scrollable one still doesn't line up well.

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

21 Feb 2019, 10:48

Space wrote:
21 Feb 2019, 00:49
Hi,

Here's an example:
https://stackblitz.com/edit/github-5vfjwy

I'm wondering how, if it's possible, to specify column width when using column groups (colspan). The example I linked above shows a use-case.

I can set the width of the columns in the scrollable table body, but the headers (which I see are a separate table element) always have an even split of width for columns as long as there is another column that is spanning.

I can see that the first example would work if the table were not set to fixed layout, but the scrollable one still doesn't line up well.
Hi,
It's seems to be bug. You can create ticket in https://github.com/primefaces/primeng/issues .

Best Regards.

Space
Posts: 12
Joined: 23 May 2017, 22:51

21 Feb 2019, 22:04

Actually, while submitting this issue the github "related issues" beta showed me this:

https://github.com/primefaces/primeng/issues/4927

and using the colgroup solution that cagatay posted in that issue, I was able to get my issue fixed. So it works as long as I use the colgroup template.

Thanks!

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

22 Feb 2019, 12:45

Space wrote:
21 Feb 2019, 22:04
Actually, while submitting this issue the github "related issues" beta showed me this:

https://github.com/primefaces/primeng/issues/4927

and using the colgroup solution that cagatay posted in that issue, I was able to get my issue fixed. So it works as long as I use the colgroup template.

Thanks!
Glad to hear!

frenz4ever
Posts: 1
Joined: 26 Nov 2021, 17:16

26 Nov 2021, 17:31

yigitfindikli wrote:
22 Feb 2019, 12:45
Space wrote:
21 Feb 2019, 22:04
Actually, while submitting this issue the github "related issues" beta showed me this:

https://github.com/primefaces/primeng/issues/4927

and using the colgroup solution that cagatay posted in that issue, I was able to get my issue fixed. So it works as long as I use the colgroup template.

Thanks!
Glad to hear!
Migrated from primeng 11 to primeng 12 and the widths of columns were not adjustable anymore (the same width were applied to all of them).

I had to change from

Code: Select all

[style]="{'width': col.width}"
to

Code: Select all

[style]="{'max-width': col.width}"
source: https://www.primefaces.org/primeng/show ... ble/scroll

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests