Cellpadding
CellPadding attribute is used to control the spacing between the contents of a Cell and the Cell’s border.
<table border="1" cellspacing="5">
The above code set the space between the Cell border and the Cell content to 5 pixels.
The above picture shows an HTML Table with cellpadding=15 and another one is HTML Table with no Cellpadding.
HTML Source Code :
<html>
<body >
<table border=1 cellpadding=15>
<tr>
<td>
January
</td>
<td>
February
</td>
</tr>
<tr>
<td>
March
</td>
<td>
April
</td>
</tr>
</table>
</body>
</html>
The Cellpadding is uniform for the entire table, individual Cellpadding in Table Cells cannot be specified. The padding amount specified is added to all four sides of the cell.
Basically, cellpadding allows for more “white space” , if you want no spaces around your text inside the Table Cell, you should set Cellpadding=”0″, otherwise the default is Cellpadding=”1″ will set , even if you don’t mention Cellpadding.
The cellpadding attribute is similar to the cellspacing attribute, which is used to create space between and outside of the table cells.