CSS implementation, with expression but in the actual central recommended use, occupy resources and Firefox browser does not support
<style> db tr{background-color:expression (' #000000, #333333, #555555, #777777, #999999, #bbbbbb, #dddddd, # Ffffff '. Split (', ') [rowindex%8]); } </style> <table width= border= "1" class= "db" > <tr> <td> </td> </tr& Gt <tr> <td> </td> </tr> <tr> <td> </td> </tr> <TR&G T <td> </td> </tr> <tr> <td> </td> </tr> <tr> <TD&G t; </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td& Gt </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr& Gt <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </ tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr& Gt <td> </td> </tr> <tr> <td> </td> </tr> <tr> <TD&G t; </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td& Gt </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr& Gt </table>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
You can change that when you're two colors.
<style>
. DB tr{
Background-color:expression (' #abcdef, #123456 '. Split (', ') [rowindex%2]);
}
</style>
<style> db {border-collapse:collapse;} . db tr{background-color:expression (' #F8F8F8, #EFEFEF '. Split (', ') [rowindex%2]);} </style> <table width= "100%" border= "1" class= "db" > <tr> <td> </td> </tr> &l t;tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> < td> </td> </tr> <tr> <td> </td> </tr> <tr> <TD>&NBSP;&L t;/td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> ;/tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> < tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td > </td> </tr> <tr> <td> </td> </tr> <tr> <td> < /TD> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr > <td> </td> </tr> <tr> <td> </td> </tr> <tr> <TD&G t; </td> </tr> <tr> <td> </td> </tr> <tr> <td> </t d> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr > <tr> <td> </td> </tr> <tr> <td> </td> </tr> <TR&G T <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td>&nbs p;</td> </tr> </table> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td>&nb Sp;</td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <t r> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td& gt; </td> </tr> <tr> <td> </td> </tr> <tr> <td> </ td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </t r> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr& Gt <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td>&nbs p;</td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </ td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </t R> </table>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
If you really want to use, you can use the following JS write
<table id= "list" width= "> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </TR&G T <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td>&nbs p;</td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <script type= "Text/javascript" > <!--var colorarr = new Array ("#ffffff", "#c CCCCC "," #999999 ", "#666666", "#333333"); var s = 0; function Listdoodle () {var list = document.getElementById ("list"). getElementsByTagName ("tr"); for (var i=0;i<list.length i++) {list[i].style.backgroundcolor = colorarr[s++]; if (s== (colorarr.length-1)) {s = 0; }} window.onload = Listdoodle; --> </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]