Basic HTML

 
 
          

Table >> Spacing >> Cell Spacing

 

Cell Spacing

We use cell spacing to prevent the table from being crowded, we add spaces between cells so it may look wider and not crowded.


To apply cell spacing on your table, simply add this property on your <table> tag, cellspacing=""

Take a look at the examples below:

HTML - Code Description Sample Output
<table border=1 cellspacing=0>
<tr>
<td>1
<td>2
<td>3
<tr>
<td>4
<td>5
<td>6
<tr>
<td>7
<td>8
<td>9
</table>
  • No Cell Spacing
  • Border = 1
  • 1 2 3
    4 5 6
    7 8 9
    <table border=1 cellspacing=5>
    <tr>
    <td>1
    <td>2
    <td>3
    <tr>
    <td>4
    <td>5
    <td>6
    <tr>
    <td>7
    <td>8
    <td>9
    </table>
  • Cell Spacing = 5
  • Border = 1
  • 1 2 3
    4 5 6
    7 8 9
    <table border=1 cellspacing=10>
    <tr>
    <td>1
    <td>2
    <td>3
    <tr>
    <td>4
    <td>5
    <td>6
    <tr>
    <td>7
    <td>8
    <td>9
    </table>
  • Cell Spacing = 10
  • Border = 1
  • 1 2 3
    4 5 6
    7 8 9

    Table >> Spacing Table >> Spacing >> Cell Padding