PrimeNG 13 colgroup is not working when scrollable property is turned on
I'm submitting a
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[x] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports) https://stackblitz.com/edit/primeng-tablecolgroup-demo-fpgcts
Current behavior If I turn on the scrollable property, the colgroup is not working.
Expected behavior The colgroup should also work with scrollable table.
Minimal reproduction of the problem with instructions I created a button which is toggle the scrollable property. You can see the header is going to pieces.
What is the motivation / use case for changing the behavior? We want to create a scrollable table with colgroups using rowspan/colspan. We were able to do it earlier with PrimeNG 11.
-
Angular version: 13.1.1
-
PrimeNG version: 13.0.4
-
Browser: Chrome
I think the combination of that with the change to make scrollable tables to have display flex is increasing the usual upgrade time of 1-2 days to nearly 2 weeks given we need to look into individual components and there is not one fix for all components.
We were using colgroup as a way to set the width for the columns, but once scrollable is configured, that is not observed. I think the recommendation for setting width now is to set on both th and td columns.
Hi,
You need to use 'headergrouped' template instead of 'header' template.
<ng-template pTemplate="headergrouped"...
is this "headergrouped" template documented anywhere?
@dcanning
Yes, you can see on this page: http://primefaces.org/primeng/table.
Search for "headergrouped".
In Column grouping section: "Columns can easily be grouped using templating. Let's start with sample data of sales of brands per year. Note that if you use Scrollable table should be used headergrouped and footergrouped templates instead of header and footer templates."