Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSF Datatable: How to style first row <tr>

 
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
 
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
 
Saloon Keeper
Posts: 22248
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
    Bookmark Topic Watch Topic
  • New Topic