Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting Column width for primefaces datatable

 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


Need some help in setting the column width for the datatable. However, the datatable width does not seem to be uniform.The width of the column in the datatable, seems to vary depending on the column header length. please refer the code below.



In the above case, the column header value length 'View Sales History/Forecast' seems to be large and hence the column width also seems to expand depending on the column header text value. Can you please let me know if there is any way to actually maintain uniformity in the column width and that not depend on the column header text value.

In case if the column header text length is too large, is there a way to maintain uniformity in the column width ?? please Assist. Thanks in Advance
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you put the outputText inside a <div> tag, and then put a style="width: 15px;" on it, it would force the contents of the DIV to conform to that width. However, instead of just clipping off the end of the text, it would wrap it. So you mgiht get a column where hte header looks like:

Vie
w S
ales
His
tory
/For
cast

or something similar. Or you could come up with a smaller column header name, and put a tooltip on it to give the full text. That's what we're doing in some of our tables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic