html <col> 標(biāo)簽設(shè)置了 <colgroup> 元素內(nèi)部的每一列的列屬性 使用 <col> 標(biāo)簽可以向整個(gè)列應(yīng)用樣式,而不需要重復(fù)為每個(gè)單元格或每一行設(shè)置樣式 屬性
范例<colgroup> 和 <col> 標(biāo)簽為表格中的三個(gè)列設(shè)置了背景色 <table border="1"> <colgroup> <col span="2" style="background-color:red"> <col style="background-color:yellow"> </colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr> </table> HTML 4.01 與 HTML5 之間的差異HTML5 中不再支持 HTML 4.01 中的大部分屬性 HTML 與 XHTML 之間的差異在 HTML 中,<col> 標(biāo)簽沒有結(jié)束標(biāo)簽 在 XHTML 中,<col> 標(biāo)簽必須被正確的關(guān)閉 |