Home  >  Article  >  Web Front-end  >  The color changing effect of table columns (rows) makes the table structure clearer_Other special effects

The color changing effect of table columns (rows) makes the table structure clearer_Other special effects

WBOY
WBOYOriginal
2016-05-16 17:45:441265browse

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> window.onload = function(){ //returnColor("test"); setColor("test"); } function setColor(id) { var trs=document.getElementById(id).getElementsByTagName("tr"); for(var i=0; i<trs.length; i++) { var tds = trs[i].getElementsByTagName("td"); for(var j=0; j<tds.length; j++) { if(j%2==1) { tds[j].className="over"; } else { tds[j].className="out"; } } } } </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn