<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>不变色</td>
</tr>
<tbody id="goaler">
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
</tbody>
<tr>
<td>不变色</td>
</tr>
</table>
<script language="JavaScript">
<!--
var TbRow = document.getElementById("goaler");
if (TbRow != null)
{
for (var i=0;i<TbRow.rows.length ;i++ )
{
if (TbRow.rows[i].rowIndex%2==1)
{
TbRow.rows[i].style.backgroundColor="";
}
else
{
TbRow.rows[i].style.backgroundColor="#F1F1F1";
}
}
}
//-->
</script>
<tr>
<td>不变色</td>
</tr>
<tbody id="goaler">
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
<tr>
<td>xxxxxxxx</td>
</tr>
</tbody>
<tr>
<td>不变色</td>
</tr>
</table>
<script language="JavaScript">
<!--
var TbRow = document.getElementById("goaler");
if (TbRow != null)
{
for (var i=0;i<TbRow.rows.length ;i++ )
{
if (TbRow.rows[i].rowIndex%2==1)
{
TbRow.rows[i].style.backgroundColor="";
}
else
{
TbRow.rows[i].style.backgroundColor="#F1F1F1";
}
}
}
//-->
</script>
标签:
JS控制表格隔行变色
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“JS控制表格隔行变色”评论...