How to change Alternate Table Row Colors in struts

Problem

i'm using <logic:iterator> tag to Display table data like this

    <logic:iterate id="LT" name="lastToken" scope="request">
        <tr>
          <td class="TblHometd"><bean:write name="LT"  property="tokennumber" format="#"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="adjustmenttime" format="hh:mm:ss"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="actualfinishedtime" format="hh:mm:ss"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="consultationtype"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="mobileno" format="#"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="consultationstatus"/></td>
          <td class="TblHometd"><bean:write name="LT"  property="smsstatus"/></td>
        </tr>
   </logic:iterate>

now i want to change background color for alternate rows how can i do this ????

thanks in advance

Problem courtesy of: Clarence

Solution

Use this

    tr td{
       background:yellow
    }
   tr:nth-child(odd) td{    
      background:red
    }

DEMO

Solution courtesy of: Sowmya

Discussion

CSS:

table#LT tr:nth-child(odd) {
    background-color: #F00; 
}
Discussion courtesy of: Samuel Liew

This recipe can be found in it's original form on Stack Over Flow.