title: Groovy/Grails - Need to retrieve List index value
body: <p>I need to retrieve the index position of each value in a list I have. I'm doing this so that I can display a gsp table with alternating row background colors. For example:</p>
  
  <pre><code>(list.indexVal % 2) == 1 ? 'odd' : 'even'
  </code></pre>
  
  <p>How can I get the index position number of each item in a Groovy list? Thanks!</p>