cellspacing表格单元格间距设置
cellpadding表格单元边沿与单元内容之间的间距设置
border设置表格边框大小
<html>
<body><p>Table with cellspacing and cellpadding:</p>
<table border="10"cellspacing="5" cellpadding="50">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<p>Table without others:</p>
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<p>Table with cellspacing:</p>
<table border="1"cellspacing="10">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<p>Table with cellpadding:</p>
<table border="1" cellpadding="10">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<p><b>Note:</b> The cellpadding attribute is not supported in HTML5. Use CSS instead.</p>
</body>
</html>
Table with cellspacing and cellpadding:
Month | Savings |
---|---|
January | $100 |
Table without others:
Month | Savings |
---|---|
January | $100 |
Table with cellspacing:
Month | Savings |
---|---|
January | $100 |
Table with cellpadding:
Month | Savings |
---|---|
January | $100 |
Note: The cellpadding attribute is not supported in HTML5. Use CSS instead.