Style borderSpacing attribute
- Fari ɗanin borderRightWidth
- Fari ɗanin borderStyle
- Fari ɗanin Object na HTML DOM Style
Definition and usage
borderSpacing
Attribute setting or return the space between cells in the table.
Note:If borderCollapse is set to collapse
If two length values are specified, the first sets the horizontal spacing, and the second sets the vertical spacing.
See also:
CSS Tutorial:CSS ɗanin tabi
CSS Reference Manual:border-spacing attribute
Instance
Example 1
Set the spacing between cells in the table:
document.getElementById("myTable").style.borderSpacing = "20px";
Example 2
Return the space between cells in the table:
alert(document.getElementById("myTable").style.borderSpacing);
Syntax
Return borderSpacing attribute:
object.style.borderSpacing
Set borderSpacing attribute:
object.style.borderSpacing = "length length|initial|inherit"
Attribute value
Value | Description |
---|---|
length length |
Specify the spacing between cells in length units. Negative values are not allowed. The default value is 0. If one length value is specified, both horizontal and vertical spacing are set at the same time. If two length values are specified, the first sets the horizontal spacing, and the second sets the vertical spacing. |
initial | Set this property to its default value. See initial。 |
inherit | Inherit this property from its parent element. See inherit。 |
Technical details
Default value: | 0 |
---|---|
Return value: | A string that represents the space between cells in the table. |
CSS version: | CSS2 |
browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Dakoki | 9.0 | Dakoki | Dakoki | Dakoki |
- Fari ɗanin borderRightWidth
- Fari ɗanin borderStyle
- Fari ɗanin Object na HTML DOM Style