2013-02-14 60 views
4

交替表行颜色我使用<logic:iterator>标记来显示这样如何更改支柱

<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> 

现在我想改变我background color for alternate rows怎么能做到这一点的表数据????

在此先感谢

回答

1

使用此

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

DEMO

2

CSS:

table#LT tr:nth-child(odd) { 
    background-color: #F00; 
}