Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6000021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:38:03+00:00 2026-05-23T00:38:03+00:00

I have gsp table, and I’m filling values in its fields from collection passed

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:38:04+00:00Added an answer on May 23, 2026 at 12:38 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gsp template, where the data for create view is passed through
I have a Grails gsp view with a remoteField. The remoteField calls a controller
I have a template that exists under views/dashboard/_myTemplate.gsp and from the DashboardController I can
I have problem with encode slash in url. Problem: from request in GSP page:
I have table in my gsp. And I want to have vertical scroll bar
I have the following gsp page: <g:def var=incidentMngmntId value=${incidentMngmntInstance?.id}/> <g:link controller=ticketMngmnt action=list params=[incidentMngmntId :
I have configured spring security core plugin using requestmap table inside the database.. Now
I have the folowing gsp page: <g:form controller=?? action=??> <h1>Search</h1> <g:submitButton name=search value=Search/> <div
I have a table, build inside an tag. The table is centered in the
In my gsp view, I have this code : <g:each in=${fileResourceInstanceList} status=i var=fileResourceInstance> <tr

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.