Horje

Full Example of HTML Table - Cell Spacing

To change the space between table cells, use the CSS border-spacing property on the table element:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
}
table {
  border-spacing: 30px;
}
</style>
</head>
<body>

<h2>Cellspacing</h2>
<p>Change the space between the cells with the border-spacing property.</p>

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>
    <td>80</td>
  </tr>
</table>

</body>
</html>

Output should be:

Full Example of HTML Table - Cell Spacing



Related Articles
What is HTML Table Padding HTML Table Padding and Spacing
What is HTML Table Spacing HTML Table Padding and Spacing
How to create HTML Table - Cell Padding HTML Table Padding and Spacing
How to create HTML Table - Cell Spacing HTML Table Padding and Spacing

Single Articles
Example of The HTML charset AttributeHTML Table Padding and Spacing

Type:
Html
Category:
Web Tutorial
Sub Category:
HTML Table Padding and Spacing
Uploaded by:
Admin



Share on: