CSS border spacing property is used to define the amount of spacing for the adjacent borders of tables.
Syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<style> table{ border: 1px solid orange; border-collapse: separate; border-spacing: 15px; } table td{ border: 1px solid red; } </style> <table> <tr> <th>Prop Name</th> <th>Prop Type</th> </tr> <tr> <td>Medium size Bat</td> <td>Wood Material</td> </tr> <tr> <td>Long ribbon</td> <td>Cottom Material</td> </tr> </table> |
Output
Prop Name | Prop Type |
---|---|
Medium size Bat | Wood Material |
Long ribbon | Cottom Material |
CSS border spacing values list
Sr. No. | value | Description |
---|---|---|
1 | length | This is Used to give border spacing length for tables cells. The value for this can be in px ,cm, em or in percentage etc. If you specify one length, it should be for both horizontal and vertical. |
2 | initial | Used to define as the property initial value. |
3 | inherit | Used to define the computed value of property on the elements parent. |