border-collapse Attribute | borderCollapse Property

MS Office DHTML, HTML & CSS

border-collapse Attribute | borderCollapse Property


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

Syntax

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

Possible Values

sCollapse String that specifies one of the following values:
separate Borders are detached (standard HTML).
collapse Borders are collapsed, where adjacent, into a single border.

The property is read/write with 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 dynamic propertiesInternet Link.

Example

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

Sample Code

<TABLE ID=oTable 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="oTable.style.borderCollapse='separate'" 
   VALUE="separate">
<INPUT TYPE=button 
   onclick="oTable.style.borderCollapse='collapse'" 
   VALUE="collapse">

This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
TABLE

See Also

border


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.