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.
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.
Seems to still be an issue
Here is the Plunkr that shows that the problem still exists
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.
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:
Most helpful comment
Could this issue be reopened ?
Because many peoples state that it is not fixed.