HTML DOM Style borderSpacing property
Examples
Set the distance between the cells in the table:
document.getElementById("myTable").style.borderSpacing="20px";
try it"
Definition and Usage
borderSpacing property sets or returns the distance between the cells of the table.
Note: If borderCollapse set to collapse, then the property does not work.
Browser Support
All major browsers support borderSpacing property.
Note: IE7 and earlier versions do not support borderSpacing property.IE8 requires a! DOCTYPE. IE9 support this property.
grammar
Back borderSpacing properties:
object .style.borderSpacing
Setting borderSpacing properties:
object .style.borderSpacing="length length|initial|inherit"
Property Values
值 | 描述 |
---|---|
length length | 以长度单位形式规定单元格之间的距离。不允许使用负值。默认值是 0。
|
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
technical details
Defaults: | 0 |
---|---|
return value: | String that represents the distance between the cells in a table. |
CSS version | CSS2 |
More examples
Examples
Returns the distance between cells in a table:
alert(document.getElementById("myTable").style.borderSpacing);
try it"
related articles
CSS tutorial: CSS the Table (table)
CSS Reference: border-spacing property