Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Datatable: How to style first row <tr>

 
Ajay Kamble
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way in JSF to style ONLY the first <tr>, give it specific color etc.?

I know we can specify styles for alternate rows but I do not know how to style ONLY the first row.

Regards,
Ajay
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I read about this last nite

use <f:facet> in your <h:column> tag

so look it up
 
Tim Holloway
Bartender
Posts: 18420
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way would be to stack 2 identical datatables (except for row classes), but that's cumbersome.

I think you could create a control binding and alter the rowclass for the first row, although I can't visualize all the details.

Or, if you're limiting the size of the table to, say 10 rows (for small or paged table displays), you can just do brute-force. I'm assuming you want both an alternate style of row 1 and ledger ruling:



Finally - and this is often the best way - are you actually just trying to create a heading row? Because dataTable has provisions for headers and footers.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!