CellSpacing 和CellPadding的区别

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:

MonthSavings
January$100

Table without others:

MonthSavings
January$100

Table with cellspacing:

MonthSavings
January$100

Table with cellpadding:

MonthSavings
January$100

Note: The cellpadding attribute is not supported in HTML5. Use CSS instead.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值