I used width attribute as for all columns but In display, columns are not adjusted.
Can i get in this way? If, please guide me to achieve column widths as I desired.
you must to use columnClasses attribute and separate every column style with comma(,). the code examples below show how to use columnClassess attribute.
in head tag:
<style type="text/css">
            .column1{width: 10px;height:auto}
            .column2{width: 5px;height:auto}
            .column3{width: 20px;height:auto}
           </style>
in body tag:
<p:panelGrid columnClasses="column1,column2,column3" columns="4" style="width: 100%" >  
                    <p:column></p:column>                        
                    <p:column></p:column>
                    <p:column></p:column> 
                    <p:column></p:column> 
                </p:panelGrid>  
it is works with h:panelGrid tag too.
you can either use a hard coded value:
<p:column style="width:20px">
or a percentage :
<p:column style="width:20%">
depending on what suits you best.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With