Datatable width / horizontal scroll problem

UI Components for JSF
Post Reply
tosh
Posts: 5
Joined: 29 Jun 2011, 10:04

30 Jun 2011, 11:49

Hi,

Im using jsf-api 2.1.1-b04 & primefaces 3.0.M1.

Im stuck trying to add horizontal scrolling to my datatable component. According to the API I simply need to set scrollable="true" and then set a width - but I cant get it to pick it up. e.g.

Code: Select all

	        <p:dataTable 
	        	var="exceptionType" 
	        	value="#{criteriaBean.exceptionTypes}"  
                selection="#{criteriaBean.selectedExceptionTypes}" 
                selectionMode="multiple"
                scrollable="true"
                height="400"
                width="100"
				>
                <p:column headerText="Exception Type">  
		            <h:outputText value="#{exceptionType.code}" />  
		        </p:column>    
		        
		        <p:column headerText="Description">  
		            <h:outputText value="#{exceptionType.description}" />  
		        </p:column> 

            </p:dataTable>	

Im also having issues where my headers dont align exactly with the data cells.

When I look at the rendered HTML via firebug I see that the table is created with :

Code: Select all

<div id="j_idt8:j_idt16" class="ui-datatable ui-widget ui-datatable-scrollable" style="width: 853px;">
there are no settings on the header :

Code: Select all

<div id="j_idt8:j_idt16" class="ui-datatable ui-widget ui-datatable-scrollable" style="width: 853px;">
but the body element has picked up the height attribute :

Code: Select all

<div class="ui-datatable-scrollable-body" style="height:400px">

Thanks for any help

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 43 guests