Primeng: DataTable column width not effective when headerColumnGroup has more than 1 header row

Created on 10 Mar 2017  路  13Comments  路  Source: primefaces/primeng

If thead has 2 row header, first row column width can be divided in second row header with required % or px. but the second row header always equally divided. its default HTML behavior if we have more than 1 row in thead.

Header
first row has 3 columns,
second row has 11 columns. those 11 divided into 3 columns as 2, 4, 5.

<p-headerColumnGroup> <p-row> <p-column header="Projects" [style]="{'width':'30%'}" colspan="2"></p-column> <p-column header="Capital ReAllocation" [style]="{'width':'30%'}" colspan="4"></p-column> <p-column header="Capital Additional and Actual Spent" [style]="{'width':'40%'}" colspan="5"></p-column> </p-row> <p-row> <p-column header="Project #" [style]="{'width':'25%'}"></p-column> <p-column header="Project Description" [style]="{'width':'75%'}"></p-column>

HTML Solution for this issue can be found here. But I think, the actual Implementation has to be changed at DataTable.

http://stackoverflow.com/questions/13841700/how-can-i-set-the-widths-of-a-two-row-header-table-with-table-layout-fixed

Most helpful comment

Could this issue be reopened ?
Because many peoples state that it is not fixed.

All 13 comments

Some work around, it adds one more empty th row . still the issue exists.
<p-headerColumnGroup> <p-row> <p-column [style]="{'width':'4%'}"></p-column> <p-column [style]="{'width':'24%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> <p-column [style]="{'width':'9%'}"></p-column> </p-row> <p-row> <p-column header="Projects" [style]="{'width':'30%'}" colspan="2"></p-column> <p-column header="Capital ReAllocation" [style]="{'width':'30%'}" colspan="4"></p-column> <p-column header="Capital Additional and Actual Spent" [style]="{'width':'40%'}" colspan="5"></p-column> </p-row> <p-row> <p-column header="Project #" [style]="{'width':'5%'}"></p-column> <p-column header="Project Description" [style]="{'width':'25%'}"></p-column>

This should be fixed in recent PrimeNG release, please try with it and if the issue persists drop a comment with along with a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/Wj39h1?p=preview

Seems to still be an issue

Here is the Plunkr that shows that the problem still exists

http://plnkr.co/edit/mqsJIb?p=preview

Confirming issue with PrimeNG 4.2

Same to me, also with the new 4.2.0 release. Headers and fields columns width style does not apply when using headerColumnGroup.

http://plnkr.co/edit/r4livh?p=preview

Still an issue in 4.2.2

Could this issue be reopened ?
Because many peoples state that it is not fixed.

Yes, please reopen, and fix

Yes @cagataycivici please reopen, I have the same problem as @billfranklin and @upstreamosGH...

Still an issue in 5.0.2

@cagataycivici This issue needs to be open. It is still an issue in the current release. This is easy to reproduce.

Helped here is this:
-//-

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philly-vanilly picture philly-vanilly  路  3Comments

Helayxa picture Helayxa  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

Helayxa picture Helayxa  路  3Comments