HTML DOM borderSpacing Property
Complete Style Object Reference
Definition and Usage
The borderSpacing property sets the distance between the borders of adjacent
cells (only for the "separated borders" model).
Syntax
Object.style.borderSpacing=length,length
|
Possible Values
Value |
Description |
length |
Defines the distance in px, cm, etc. If one length parameter is specified, it
defines the horizontal and vertical
spacing. If two length parameters are specified, the first sets the horizontal spacing
and the second sets the vertical spacing |
Example
The following example sets the distance between the borders of adjacent
cells:
<html>
<head>
<script type="text/javascript">
function changeBorderSpacing()
{
document.getElementById('myTable').style.borderSpacing="10px"
}
</script>
</head>
<body>
<table border="1" id="myTable">
<tr>
<td>100</td>
<td>200</td>
</tr>
<tr>
<td>300</td>
<td>400</td>
</tr>
</table>
<input type="button" onclick="changeBorderSpacing()"
value="Change border spacing">
</body>
</html>
|
Try-It-Yourself Demos
borderSpacing - Change the distance between the borders of adjacent cells
Complete Style Object Reference
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|