HTML <table> 標(biāo)簽
tr
元素定義表格行,th
元素定義表頭,td
元素定義表格單元渐裸。
表格中的屬性
<table border="1" cellspacing="0" cellpadding="10">
<caption>table常用屬性</caption>
<tr>
<td>屬性名</td>
<td>含義</td>
<td>值</td>
</tr>
<tr>
<td>border</td>
<td>設(shè)置邊框茎活,默認(rèn)0,沒(méi)有邊框</td>
<td>px</td>
</tr>
<tr>
<td>cellspacing</td>
<td>設(shè)置單元格與單元格之間的距離</td>
<td>默認(rèn)為2px,px,%</td>
</tr>
<tr>
<td>cellpadding</td>
<td>設(shè)置文字與單元格之間的距離</td>
<td>默認(rèn)為1px,px,%</td>
</tr>
單元格合并
<tr>
<td colspan="2">1</td> 跨行
<td rowspan="2">1</td> 跨列
</tr>
caption屬性可以設(shè)置表格的標(biāo)題
<table>
<caption>表格標(biāo)題</caption>
</table>