Click to Rate and Give Feedback
Properties
 borderCollapse Property
border-collapse Attribute | borderCollapse Property

Sets or retrieves a value that indicates whether the row and cell borders of a table are joined in a single border or detached as in standard HTML.

Syntax

HTML { border-collapse : sCollapse }
Scripting[ sCollapse = ] object.style.borderCollapse

Possible Values

sCollapseString that specifies or receives one of the following values.
separateDefault. Borders are detached (standard HTML).
collapseBorders are collapsed, where adjacent, into a single border.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of separate. The Cascading Style Sheets (CSS) attribute is not inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Example

This example demonstrates how to use the border-collapse attribute and the borderCollapse property to manipulate the border on a table.

<table id="oID_1" style="border-collapse: collapse">
        <tr>
            <td>EST</td>
            <td>9:00 a.m.</td>
        </tr>
        <tr>
            <td>CST</td>
            <td>8:00 a.m.</td>
        </tr>
        <tr>
            <td>PST</td>
            <td>6:00 a.m.</td>
        </tr>
    </table>
    <p>
    <input type="button" onclick="oID_1.style.borderCollapse='separate'" value="separate">
    <input type="button" onclick="oID_1.style.borderCollapse='collapse'" value="collapse">
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2) World Wide Web link.

Applies To

currentStyle, runtimeStyle, style, TABLE

See Also

border
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker