Tables : Lesson 4

Cell Padding and Cell Spacing
Cell Padding is the amount of space between text and boundaries of a cell.
Cell Spacing is the distance between two cells.

Without cellpadding or cellspacing:

First Row
Second Row

With cellpadding:

First Row
Second Row

With cellpadding and cellspacing:

First Row
Second Row


<h4>Without cellpadding or cellspacing:</h4>
<table border="1">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

<h4>With cellpadding:</h4>
<table border="1" cellpadding="10">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

<h4>With cellpadding and cellspacing:</h4>
<table border="1" cellpadding="10" cellspacing="15">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>   
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

I think this is self-explanatory.

Tables  1  2  3  4  5  prev  next