HTML DOM borderCollapse Property
Complete Style Object Reference
Definition and Usage
The borderCollapse property sets whether a table border should be collapsed into a
single border or detached as in standard HTML.
Syntax
Object.style.borderCollapse=collapse|separate
|
Possible Values
Value |
Description |
separate |
Default. Borders are detached |
collapse |
Borders are collapsed into a single border when
possible |
Example
The following example collapses a table border:
<html>
<head>
<script type="text/javascript">
function setBorderCollapse()
{
document.getElementById('myTable').style.borderCollapse="collapse"
}
</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>
<br />
<input type="button" onclick="setBorderCollapse()"
value="Collapse border">
</body>
</html>
|
Try-It-Yourself Demos
borderCollapse - Collapse the table border into a single border
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).
|
|