<br>在HTML語言中,可以自動透過標記為表格新增標題。另外,表格的第一行稱為表頭,這也可以透過HTML標記來實現。 <br>基本語法 <br> <table> .... <table> .... <br> <tr> <br> <th>标题1</th> <th>标题2</th> <th>标题3</th> <th>标题4</th> <th>标题5</th> <br> </tr> <br> ........ <br> </table> <tr> <br> <br>標題1<br>標題2<br>標題3<br><title>標題4</title> <br>標題5<br>標題4<br>標題5<table border="1" width="80%" bgcolor="#e8e8e8" cellpadding="2" bordercolor="#0000ff" bordercolorlight="7d7dff" bordercolordark="#0000a0"> <br><tr> <br><th width="30%" colspan="2" valign="bottom">大西洋赛区</th> <br><th width="30%" colspan="2" valign="bottom">中部赛区</th> <br><th width="30%" colspan="2" valign="bottom">东南赛区</th> <br> </tr> <br><tr> <br><td width="16%" align="center">凯尔特人</td> <br><td width="16%" align="center">76人</td> <br><td width="17%" align="center">活塞</td> <br><td width="17%" align="center">公牛</td> <br><td width="17%" align="center">热火</td> <br><td width="17%" align="center">奇才</td> <br> </tr> <br><tr> <br><td width="16%" align="center">网</td> <br><td width="16%" align="center">尼克斯</td> <br><td width="17%" align="center">步行者</td> <br><td width="17%" align="center">骑士</td> <br><td width="17%" align="center">魔术</td> <br><td width="17%" align="center">山猫</td> <br> </tr> <br><tr> <br><td width="16%" align="center">猛龙</td> <br><td width="16%" align="center">过江</td> <br><td width="17%" align="center">雄鹿</td> <br><td width="17%" align="center">芝加歌</td> <br><td width="17%" align="center">老鹰</td> <br><td width="17%" align="center">姚明</td> <br> </tr> <br> </table> <br>標題4<br>標題5<br>標題4<th></th>名稱 </tr> ........ </table> 文法解釋 透過BORDER屬性定義邊框線的寬度,單位為像素。 表格標記的綜合例子<table border="1" width="80%" bgcolor="#e8e8e8" cellpadding="2" bordercolor="#0000ff" bordercolorlight="7d7dff" bordercolordark="#0000a0"> <tr> <th width="30%" colspan="2" valign="bottom">大西洋賽區</th> <th width="30%" colspan="2" valign="bottom">中部賽區</th> <th width="30%" colspan="2" valign="bottom">東南賽區</th> </tr> <tr> <td width="16%" align=" center">凱爾特人</td> <td width="16%" align="center">76人</td> <td width="17%" align="center">活塞</td> <td width="17%" align="center">公牛</td> <td width="17%" align="center">熱火</td> <td width="17%" align="center">奇才</td> </tr> <tr> <td width="16%" align="center ">網</td> <td width="16%" align="center">尼克斯</td> <td width="17%" align="center">步行者</td> <td width="17%" align="center">騎士</td> <td width="17%" align="center">魔術</td> <td width="17%" align="center">山貓</td> </tr> <tr> <td width="16%" align="center">猛龍</td> <td width="16%" align="center">過江</td> <td width="17%" align="center">雄鹿</td> <td width="17%" align="center">芝加歌</td> <td width="17%" align="center">老鷹</td> <td width="17%" align="center">姚明</td> </tr> </table> 其中是指的表格的表頭和標題。