zoukankan      html  css  js  c++  java
  • 表格隔行换色

    <HTML > 
    <HEAD > 
    <TITLE >HTML网页中行与行间隔的表格就是上行与下一行用不同颜色</TITLE >

    <script type="text/javascript">
     function fun(){
         var tr=document.getElementsByTagName("tr");
           for(var i=0;i<tr.length;i++)
           {
             tr[i].style.background=tr[i].rowIndex % 2==0?"#F0FFF0":"white";
           }
       }
       
     window.onload=fun;
    </script>

    </HEAD > 
    <BODY > 
    <table> 
    <tr > <th >123 </th > <th >aaa </th > <th >bcx </th > </tr > 
    <tr > <td >sadfsadf </td > <td >ssdf </td > <td >sde </td > </tr > 
    <tr > <td >asfdf </td > <td >fds </td > <td >fdfsa </td > </tr > 
    <tr > <td >sdf </td > <td >sdf </td > <td >fdsaf </td > </tr > 
    <tr > <td >0aasfd </td > <td >asdf </td > <td >asdf </td > </tr > 
    </table > 
    </BODY > 
    </HTML > 
    http://www.cnblogs.com/JAMJIA/archive/2010/03/05/1679469.html
  • 相关阅读:
    双飞翼布局 & 圣杯布局
    php正则
    面向对象-object对象
    面向对象-赋值运算
    面向对象-作用域
    js高级-面向对象
    8.5学习笔记
    10.22
    10.19
    react路由
  • 原文地址:https://www.cnblogs.com/lkf18/p/2378041.html
Copyright © 2011-2022 走看看