Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

styles for column header in dataTable  RSS feed

 
Jolie Lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
erm, that will apply to all the columns rite? my problem is to set different styles to the column HEADER....
 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think as I have applied different style in columClasses you can do so for headerClass attribute
 
Jolie Lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!