1
<table id="table1">
<colgroup><col><col><col><col></colgroup>
<tr><th class="green">th1</th><th>th2</th><th>th3</th><th>th4</th> </tr>
<tr><td class="green">Cell1</td><td>Cell2</td><td>Cell3</td><td>Cell4</td></tr>
<tr><td class="green">Cell1</td><td>Cell2</td><td>Cell3</td><td>Cell4</td></tr>
<tr><td class="green">Cell1</td><td>Cell2</td><td>Cell3</td><td>Cell4</td></tr>
<tr><td class="green">Cell1</td><td>Cell2</td><td>Cell3</td><td>Cell4</td></tr>
</table>
#table1 {width:100%; table-layout:fixed;}
#table1 td, #table1 th{border:1px solid; background-color:yellow;}
.green {background-color:green;}
我試圖避免。綠色類重要的,因爲我會寫很多那些在我的網頁,我讀它是不好的做法! http://jsfiddle.net/y3cnc0ty/