Why I can't use xx% with p:column?

UI Components for JSF
Post Reply
sharedata
Posts: 39
Joined: 22 Apr 2011, 06:42

05 May 2011, 05:33

I can use style="width: xx%" or style="width: xxpx" with p:dataTable to define dataTable' width, but why I can't use width="xx%" or style="width: xx%" with p:column? Of course, I can use style="width:xxpx" to define column's width, but I think it's not a nice way. Can any body help me?

-------------------------------------------

Code: Select all

------------------------------------------------------
// Below code is ok, but not nice:
		<p:dataTable style="width:800px" ...> 

	        <p:column style="width:120px">  
	            <f:facet name="header">  
	                <h:outputText value="#{msgs.customer_customerId}" />
	            </f:facet>  
	            <h:outputText value="#{customer.customerId}" />
	        </p:column>  
	
	        <p:column style="width:120px">  
	            <f:facet name="header">  
	                <h:outputText value="#{msgs.customer_customerTypeId}" />
	            </f:facet>  
	             <h:outputText id="customerTypeId_" value="#{customer.customertype.name}" />
	        </p:column> 
			
			...
			
		</p:dataTable>
		
------------------------------------------------------
// Below code not work! why not?!
		<p:dataTable style="width:80%" ...> 

	        <p:column style="width:15%">  
	            <f:facet name="header">...</f:facet>  
	            ...
	        </p:column>  
	
	        <p:column style="width:15%">  
	            <f:facet name="header">...</f:facet>  
	            ...
	        </p:column> 
			
			......
			
		</p:dataTable>

sharedata
Posts: 39
Joined: 22 Apr 2011, 06:42

06 May 2011, 03:17

Can any body help me?

Franke
Posts: 49
Joined: 12 Oct 2010, 08:41

06 May 2011, 09:05

Using width: xx% works percetly on a p:column. My guess is that your problem is related to basic CSS rather than PF.
Using PF 3.0 with default JSF implementation of JBoss 6

sharedata
Posts: 39
Joined: 22 Apr 2011, 06:42

07 May 2011, 09:37

Thanks! but what is wrong with my code above?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests