This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes column width in rich:datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "column width in rich:datatable" Watch "column width in rich:datatable" New topic
Author

column width in rich:datatable

Vijay jai Singh
Greenhorn

Joined: Jan 07, 2009
Posts: 26
Hi,

I am using JSF 1.2, in one of my web page i am using. I wantwidth of column in rich:datatable to set column's width.



In one of rich:column i need to set width for column, for this i tried like

1) width="100px"
2) headerClass="myWidth" and delared myWidth in css file, .myWidth {width:100px;} but both did not work.

can anyone help me to set column width.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

You don't set width in column definitions. Use the dataTable's "columnClasses" attribute.


Customer surveys are for companies who didn't pay proper attention to begin with.
Vijay jai Singh
Greenhorn

Joined: Jan 07, 2009
Posts: 26
i tried with columnClasses also but it did not work.
V Bhanu
Greenhorn

Joined: Mar 13, 2008
Posts: 2
try style="width:100px;" with semicolon
Sachin Yewale
Greenhorn

Joined: Feb 02, 2012
Posts: 21
use this :

<rich:column style="text-align:center;width:10%;">

its work for me
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Tim Holloway wrote:You don't set width in column definitions. Use the dataTable's "columnClasses" attribute.


Except in richfaces columns. I think I missed noting that this was for RichFaces.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: column width in rich:datatable
 
Similar Threads
richfaces:: richdatatable problem.
jsf + richfaces modal panel problem
Header, Footer with dynamic data
rich:dataTable filter textfield width
Problem with RichFacese ExtendedDataTable