Hello,
even with Version 2.2 and using fixed with in every p:column (which is by the way a very hard restriction), the columns still don't match the size of the headers in my opinion common scenarios.
Steps to reproduce :
1. Render a scrollable table with fixed width on every column. -> The columns headers matches the columns -> everything is ok (for now)
2. Select an entry and edit a value. Use a long (big size) value without white-spaces for example : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
3. Save the value, update the Table.
4. Result:
Scrollable datatable: column header still not matching!
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
I think you need to use table-layout fixed to avoid overflows in widths.
It is really strange, I tried to fix the values of the columns, but nothing changes.
I spent all day yesterday trying to adapt my project to the new changes.
Not to mention that when we define the scrollable property, even if the datatable has no contents, empty space is reserved on the page defined in height.
I spent all day yesterday trying to adapt my project to the new changes.
Not to mention that when we define the scrollable property, even if the datatable has no contents, empty space is reserved on the page defined in height.
Last edited by fajo on 08 Feb 2011, 12:59, edited 1 time in total.
Netbeans 7.0.1
Mojarra 2.1.0
JavaEE 6
Primefaces 3.0.1
Mojarra 2.1.0
JavaEE 6
Primefaces 3.0.1
I just entered this issue a few days ago...
http://code.google.com/p/primefaces/iss ... &start=300
table-layout: fixed is a css property, the default is auto which apparently
goes through your data looking at column data widths to determine the
optimal column width. I've not found a good description of the algorithm
used, and I've not tried too hard either.
From my perspective nothing other than tables that automatically layout
is good enough for me to use, it's just too much hassle to go through each
and every table setting column widths, I've got loads of them.
I'm using tables with css overflow: auto, the big problem being that header
and footer data scrolls along with the row content, which isn't great.
Is it really that difficult to get this working? surely dataTable is THE no.
1 component???
http://code.google.com/p/primefaces/iss ... &start=300
table-layout: fixed is a css property, the default is auto which apparently
goes through your data looking at column data widths to determine the
optimal column width. I've not found a good description of the algorithm
used, and I've not tried too hard either.
From my perspective nothing other than tables that automatically layout
is good enough for me to use, it's just too much hassle to go through each
and every table setting column widths, I've got loads of them.
I'm using tables with css overflow: auto, the big problem being that header
and footer data scrolls along with the row content, which isn't great.
Is it really that difficult to get this working? surely dataTable is THE no.
1 component???
Ok I guess I found a working solution!
Add word-wrap: break-word to your p:column style and use "table-layout: fixed" for the tables inside the p:dataTable
<p:column style="width: 150px; word-wrap: break-word;" >
Add word-wrap: break-word to your p:column style and use "table-layout: fixed" for the tables inside the p:dataTable
<p:column style="width: 150px; word-wrap: break-word;" >
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,
The above tip worked, now would not set a fixed width for columns even when it is empty, query screens, the first appears empty datatable with the columns and set the headers and then displays when the result of a research is that the columns are not adjusted for the defined sizes.
Why not be like when you put the Paginator, it automatically distributes the columns between the width of the container, after all, not everything datatable.
Why not be like when you put the Paginator, it automatically distributes the columns between the width of the container, after all, not everything datatable.
Netbeans 7.0.1
Mojarra 2.1.0
JavaEE 6
Primefaces 3.0.1
Mojarra 2.1.0
JavaEE 6
Primefaces 3.0.1
This workaround does make the column headers and data align when there is data but it does not work when you have an empty dataset. I also agree with others that setting a fixed width in pixels for columns is not a great solution. This could be a big issue for my project.
Prime Faces 6.2
Mojarra 2.2.14
Apache Tomcat 9.0
Internet Explorer 10,11
Mojarra 2.2.14
Apache Tomcat 9.0
Internet Explorer 10,11
-
- Information
-
Who is online
Users browsing this forum: No registered users and 46 guests