Scrollable datatable header not aligning with the columns

UI Components for JSF
Post Reply
saurabh.bansal
Posts: 5
Joined: 11 Oct 2011, 20:50

11 Oct 2011, 20:56

Hi All,

I tried by changing the width but scrollable datatable header is not aligning with the table columns..

Please advice.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Oct 2011, 20:57

My advice would be to search the forum first

Cheers,

Ronald

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Oct 2011, 20:58

Oh and read one of the first posts in the forum (the one about 'read before posting')

rdelaplante
Posts: 13
Joined: 21 Oct 2010, 19:31

11 Oct 2011, 20:59

Try adding a style attribute to ALL of the p:columns

<p:column headerText="Column 1" style="width: 100px;">
#{bean.field}
</p:column>

saurabh.bansal
Posts: 5
Joined: 11 Oct 2011, 20:50

11 Oct 2011, 21:05

Hey! I have mentioned dat i hv tried by changing width. i hv already added style attribute..

rdelaplante
Posts: 13
Joined: 21 Oct 2010, 19:31

11 Oct 2011, 21:11

That is how I solved the problem in my application. I'm not sure what else to try other than searching the forums.

saurabh.bansal
Posts: 5
Joined: 11 Oct 2011, 20:50

12 Oct 2011, 20:31

still i hvnt found any solution.. :(

jimmybondy
Posts: 28
Joined: 30 Jan 2012, 17:21

14 Jun 2013, 14:25

We are facing the same problem and could not find any solution:

Our table ...
  • uses lazyDataModel
  • has multiple sorting enabled
  • has pagination enabled
  • has single selectionMode
  • has scrollable=true
  • fixed width for ALL columns using style attribute (style="width: 150px;")

Table code:

Code: Select all

<p:dataTable id="resultList" value="#{searchBean.lazyDataModel}" var="entity"
        selectionMode="single" selection="#{searchBean.selectedEntity}" rowKey="#{entity.rdsEntityId}"
        scrollable="true" scrollHeight="350" style="overflow:auto"
        paginator="true" rows="15"
        paginatorTemplate="Page {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
        rowsPerPageTemplate="5,10,15,20,25,30,35,50" paginatorPosition="bottom" paginatorAlwaysVisible="false" 
        sortMode="multiple" 
        lazy="true" 
        draggableColumns="false" resizableColumns="false" >
Example for column code::

Code: Select all

<p:column sortBy="shortName" headerText="Short Name" rendered="#{searchBean.userRoleRDM}" styleClass="wrap" style="width: 100px;">
      <h:outputText value="#{entity.shortName}" escape="false" />
</p:column>
I have read the following threads and tried their solutions with no success: Also note:
  • The problem appears in IE8 (not in FF)
  • Using PF 3.5.0 and 4.0-SNAPSHOT
---------------------------------------------------------------------------------------------------------------
  • Mojarra 2.1.19 (20130213-1512) / JSF 2.1
  • PrimeFaces 3.5.0 and 4.0-SNAPSHOT
  • Apache Tomcat/6.0.35
  • Oracle JDK 1.6.0_43
[/color]

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

14 Jun 2013, 14:33

identyical problem, completely different version, 1.5 years later, so please create a new topic.

Neat post by the way... good description, references to what you did.... etc... compliments

I think your issue is
fixed width for ALL columns using style attribute (style="width: 150px;")
use the width attribute on the colum

jimmybondy
Posts: 28
Joined: 30 Jan 2012, 17:21

14 Jun 2013, 15:42

Hi Ronald,

Thank You for your quick answer.

I have tried the width attribute before and now tried it again with no success (cleaning browser cache before hand of course).
Here is the new thread: header not aligning with columns when scrollable enabled
---------------------------------------------------------------------------------------------------------------
  • Mojarra 2.1.19 (20130213-1512) / JSF 2.1
  • PrimeFaces 3.5.0 and 4.0-SNAPSHOT
  • Apache Tomcat/6.0.35
  • Oracle JDK 1.6.0_43
[/color]

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests