Cellspacing
We can also control how much distance there will be between cells.
<body>
<table cellspacing="10" border="1">
<tr>
<td>Text1 </td>
<td>Text2 </td>
</tr>
</table>
</body>
We can make that distance even bigger:
<body>
<table cellspacing="20" border="1">
<tr>
<td>Text1 </td>
<td>Text2 </td>
</tr>
</table>
</body>
You can also put both the cellpadding and the cellspacing attributes together,
like so:
<body>
<table cellspacing="20" cellpadding="20" border="1">
<tr>
<td>Text1 </td>
<td>Text2 </td>
</tr>
</table>
</body>
By default the cellpadding and the cellspacing will be 2. By setting the
values to 0 the borders will appear as simple grey lines as shown below:
<body>
<table cellspacing="0" cellpadding="0" border="1">
<tr>
<td>Text1 </td>
<td>Text2 </td>
</tr>
</table>
</body>
|