The border-spacing
property in CSS controls how far apart cells are in a <table>
element (or an element that is made to be table-like via display: table;
).
It takes any of the lengths of CSS.
Notably, it only has any effect at all if the table is using the default border-collapse: separate;
and has no effect at all when border-collapse: collapse;
is set.
table {
border-collapse: separate;
border-spacing: 5px;
border-spacing: 1vw;
border-spacing: 2em;
}
Browser support
Chrome | Safari | Firefox | Opera | IE | Android | iOS |
---|---|---|---|---|---|---|
All | All | All | All | All | All | All |