在html中繪制表格使用table標簽
- tr表示行
- td表示列
- th表示表頭,表頭通常用于列名字。
下面是一個列子。
<html> <head> <title>Table in html</title> </head> <body> <p>水平表頭</p> <table border="1"> <tr> <th>Name</th> <th>Age</th> <th>Gender</th> </tr> <tr> <td>zdd</td> <td>30</td> <td>male</td> </tr> </table> <p>垂直表頭</p> <table border="1"> <tr> <th>Name</th> <td>autumn</td> </tr> <tr> <th>Age</th> <td>30</td> </tr> <tr> <th>Gender</th> <td>famale</td> </tr> </table> </body> </html>
效果圖
水平表頭
Name
|
Age
|
Gender
|
zdd
|
30
|
male
|
垂直表頭
Name
|
autumn
|
Age
|
30
|
Gender
|
famale
|
無邊框表格
【網站聲明】本站除付費源碼經過測試外,其他素材未做測試,不保證完整性,網站上部分源碼僅限學習交流,請勿用于商業用途。如損害你的權益請聯系客服QQ:2655101040 給予處理,謝謝支持。