Set the CSS border-spacing Property for a table:
#table1 {
border-collapse: separate;
border-spacing: 15px;
}#table2 {
border-collapse: separate;
border-spacing: 15px 50px;
}
Definition and Usage
The border-spacing property sets the distance between the borders of adjacent cells.
Note: This property works only when border-collapse is separate.
| Default value: | 2px |
|---|---|
| Inherited: | yes |
| Animatable: | yes. Read about animatable – Try it |
| Version: | CSS2 |
| JavaScript syntax: | object.style.borderSpacing=”15px” Try it |
CSS Syntax
border-spacing: length|initial|inherit;
Property Values
| Value | Description |
|---|---|
| length length | Specifies the distance between the borders of adjacent cells in px, cm, etc. Negative values are not allowed.
|
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
