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我该怎么做????

提前致谢

4

2 回答 2

2

CSS:

table#LT tr:nth-child(odd) {
    background-color: #F00; 
}
于 2013-02-14T08:05:16.217 回答
1

用这个

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

演示

于 2013-02-14T09:34:20.340 回答