I have gsp table, and I'm filling values in its fields from collection passed from controller using each tag of gsp for each row. Now I want rows which gets same value for billId field should get displayed in different color. How to do that?
Try following:
<g:each in="${billings}" status="i" var="billing">
<set var="cssClass" value"${(billing.id % 2) == 0 ? 'odd' : 'even'}"/>
<g:each in="${billing.rows}" status="i" var="row">
<span class="${cssClass}">${row.id}</span>
</g:each>
</g:each>
for every odd and even billing id you define a different css style. in you main css file you have to define the class even and odd e.g. with a background color. don't know hwo you output structure looks like, so created a sample code.