htmlcss

The border-spacing property is used in CSS and certain HTML elements. It specifies the distance between the borders of adjacent cells. This is equivalent to the cellspacing attribute in presentational HTML, but an optional second value can be used to set different horizontal and vertical spacing. This property applies only when border-collapse is separate.


Values


HTML example:

<table style="border-spacing:10px 5px; border-collapse:separate;">
<caption>Table</caption>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1.1</td>
<td>2.2</td>
<td>3.3</td>
</tr>
</table>


CSS example:

table {
       border-spacing: 10px 5px;
       border-collapse: separate;
}


See Also