提示:您可以先修改部分代碼再運行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=CBK" /><title>表格變色</title><script type="text/javascript"><!--function showtable(tableid){var odd=false;var tablename=document.getElementById(tableid)var rows=tablename.getElementsByTagName("tr");for (var j=1; j<rows.length; j++) {if (odd==true){ odd=false; }else{ rows[j].style.backgroundColor="#f8f8f8"; odd=true; }rows[j].bgc=rows[j].style.backgroundColor;rows[j].onmouseover=function(){this.style.backgroundColor="#FCF9D8";}rows[j].onmouseout=function(){this.style.backgroundColor=this.bgc;}} }window.onload=function(){showtable("table");}--></script></head><body id="" class=""><table width="100%" border="0" cellspacing="1" cellpadding="4" class="list" name="table" id="table"> <thead> <tr> <th>流程</th> <th>啟動人</th> <th>啟動時間</th> <th>狀態</th> </tr> </thead> <tbody> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> <tr> <td>測試行</td> <td>無</td> <td>2008-05-09 17:21:04</td> <td>結束</td> </tr> </tbody></table></body></html>
提示:您可以先修改部分代碼再運行