HTML DOM cellSpacing Property
Complete Table Object Reference
Definition and Usage
The cellSpacing property sets or returns the amount of space (in pixels) between
the cells
in a table.
Syntax
tableObject.cellSpacing=pixels
|
Example
The following example changes the cell spacing of a table:
<html>
<head>
<script type="text/javascript">
function spacing()
{
document.getElementById('myTable').cellSpacing="15"
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>100</td>
<td>200</td>
</tr>
<tr>
<td>300</td>
<td>400</td>
</tr>
</table>
<br />
<input type="button" onclick="spacing()" value="Change Cellspacing">
</body>
</html>
|
Try-It-Yourself Demos
Change the cellPadding and cellSpacing of a table
Complete Table 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).
|
|