第一種方法:

程序代碼 程序代碼
<style type="text/css">
<!--
tr {background-color:e­xpression((this.sectionRowIndex%2==0)?"#ddeeff":"#95caff")}
-->
</style>
</HEAD>
<table>
<tr><td>第1行</td><td>第1行</td></tr>
<tr><td>第2行</td><td>第2行</td></tr>
<tr><td>第3行</td><td>第3行</td></tr>
<tr><td>第4行</td><td>第4行</td></tr>
<tr><td>第5行</td><td>第5行</td></tr>
</table>



第二種方法:

程序代碼 程序代碼
<style type="text/css">
<!--
tr {background-color:e­xpression((this.sectionRowIndex%2==0)?"#ddeeff":"#95caff")}
td {background-color:e­xpression((this.cellIndex%2==0)?"":((this.parentElement.sectionRowIndex%2==0)?"#fff":"#b3ffff"))}
-->
</style>

</head>

<body>
<table>
<tr><td>第1行</td><td>第1行</td><td>第1行</td><td>第1行</td><td>第1行</td></tr>
<tr><td>第2行</td><td>第2行</td><td>第2行</td><td>第2行</td><td>第2行</td></tr>
<tr><td>第3行</td><td>第3行</td><td>第3行</td><td>第3行</td><td>第3行</td></tr>
<tr><td>第4行</td><td>第4行</td><td>第4行</td><td>第4行</td><td>第4行</td></tr>
<tr><td>第5行</td><td>第5行</td><td>第5行</td><td>第5行</td><td>第5行</td></tr>
</table>
</body>


文章來自: WOW

文章提供: BAYSTARS DESIGN網頁設計公司


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 ace 的頭像
    ace

    怪怪國日報

    ace 發表在 痞客邦 留言(0) 人氣()