function changecolor(table,oddLay,evenLay,color){ var t=document.getElementById(table).getElementsByTagName("tr"); for(var i=0;i<t.length;i++){ t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?oddLay:evenLay; t[i].οnmοuseοver=function(){ if(this.x!="1")this.style.backgroundColor=color; } t[i].οnmοuseοut=function(){ if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?oddLay:evenLay; } } } 然后在页面的最后一行调用 <mce:script type="text/javascript"><!-- changecolor("tab_data_title","#efefef","#fff","#E8F5FE"); // --></mce:script>