It's not a secret anymore!
The moose likes JSF and the fly likes styles for column header in dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "styles for column header in dataTable" Watch "styles for column header in dataTable" New topic
Author

styles for column header in dataTable

Jolie Lee
Ranch Hand

Joined: May 08, 2005
Posts: 87
Hi, just wanted to ask how to set styles for headers in h ataTable.

i understand that there's columnClasses, which we can set for each columns, rowClasses and headerClass. i tried to put multiple styles in headerClass but it doesn't works.

how am i going to set the style for each column header (different styles per column header)..

kindly advise.


Jys<br /><a href="http://jy-s.com" target="_blank" rel="nofollow">http://jy-s.com</a><br /> <br />Trying my very best to learn java, please forgive me if i'm asking some really stupid questions.
Priti Shah
Ranch Hand

Joined: May 10, 2005
Posts: 43
I have done something like this it works fine for me.


<h ataTable value="#{fcManagement.loggedInDevices1}" var="loggedInDevice1" bgcolor="#D8E0EF" width="100%" headerClass="dataTableHeader"
rowClasses="dataTableRowWhite, dataTableRowAdbeda"
columnClasses="width:8%;, width:20%;, width:20%;, width:50%;" rendered="#{!empty fcManagement.loggedInDevices1}">

Here I have tried to assign different widths to each column.
Hope this helps.
Jolie Lee
Ranch Hand

Joined: May 08, 2005
Posts: 87
erm, that will apply to all the columns rite? my problem is to set different styles to the column HEADER....
Priti Shah
Ranch Hand

Joined: May 10, 2005
Posts: 43
I think as I have applied different style in columClasses you can do so for headerClass attribute
Jolie Lee
Ranch Hand

Joined: May 08, 2005
Posts: 87
headerClass only accept one class instead of multiple rite?

cos i tried putting different styles in headerClass, just like wat i did for columnClasses but it did not work ...it only applied the header based on the first class.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: styles for column header in dataTable
 
Similar Threads
EL: Iterate over "sub" entities (Hibernate, Facelets)?
Alternate alignment in h:datatable headers
dataTable headerClass problem
Style of an Especific cell
set attribute in the 2nd row of a table