amphibient
amphibient

Reputation: 31378

How to make rows in h:dataTable alternate color?

I have done this many times before in other platforms where a data table is rendered through a loop and I had more control. However, h:dataTable is more high level and I can't or don't know how to embed a function on the row level that will color the background of the row differently based on whether it is an even or odd numbered row.

Is it possible and how can I rows in h:dataTable alternate color?

Upvotes: 2

Views: 1846

Answers (1)

user3278647
user3278647

Reputation: 514

Just have two classes oddRow and evenRow in the css having different background colors then use rowClasses="oddRow,evenRow" to apply the different background of the rows

Upvotes: 4

Related Questions