How to fix column width <p: panelGrid>?
I am working on a JSF application in this I just doubt the column width setting in panelGrid.
My code is:
<p:panelGrid id="grid" columns="2" cellpadding="5" styleClass="panelGrid"
style="border:none;margin:0 auto;width:500px;" >
<p:column style="width:250px">
<h:outputText value="To :" />
</p:column>
<p:column style="width:250px">
<h:outputText value="#{bean.name}" />
</p:column>
<p:column style="width:250px">
<h:outputText value="Address :" />
</p:column>
<p:column style="width:250px">
<p:outputLabel value="#{bean.address}" />
</p:column>
</p:panelGrid>
Here I want to fix the width if the first column is for 250px, so I mentioned
<p:column style="width:250px">
I tried
- how can I adjust the width & lt; p: column> in <p: panelGrid>?
- How to change panel column width in PrimeFaces
But it does not work, the column width depends on the second column. Can anyone tell me why this is happening? Or suggest any other way to do this.
+4
2 answers
<p:row />, <p:column />, Showcase. <p:row /> simmilar css. :
<p:panelGrid id="grid" columns="2" cellpadding="5" styleClass="panelGrid" style="border:none;margin:0 auto;width:500px;" >
<p:row>
<p:column style="width:250px">
<h:outputText value="To :" />
</p:column>
<p:column style="width:250px">
<h:outputText value="#{bean.name}" />
</p:column>
</p:row>
<p:row>
<p:column style="width:250px">
<h:outputText value="Address :" />
</p:column>
<p:column style="width:250px">
<p:outputLabel value="#{bean.address}" />
</p:column>
</p:row>
</p:panelGrid>
+7
. ui-grid-col css, -.
<div class="ui-grid ui-grid-responsive">
<div class="ui-grid-row">
<div class="ui-grid-col-3">
<h:outputText value="To :" />
</div>
<div class="ui-grid-col-3">
<h:outputText value="#{bean.name}" />
</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-3">
<h:outputText value="Address :" />
</p:column>
<div class="ui-grid-col-3">
<p:outputLabel value="#{bean.address}" />
</div>
</div>
+1