<table>标签的cellpadding属性设置了表格的元素的间距(以像素为单位)。HTML5 已不支持cellspacing属性,请使用 CSS 代替。
本案例设置了表格的元素之间的边距为"8"
<table border="2" cellspacing="8"> <tr> <th>教程</th> <th>学习天数</th> </tr> <tr> <td>php</td> <td>7天</td> </tr> <tr> <td>HTML</td> <td>6天</td> </tr> </table>
![]() | h5已经不支持该属性了,可用css设置,可以分别设置垂直和水平的值 如果定义两个 length 参数,那么以下第一个设置水平间距,而第二个设置垂直间距。 -webkit-border-vertical-spacing: 8px; -webkit-border-horizontal-spacing:8px; |
<table cellspacing="像素值"></table>