X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Style borderCollapse Property

Style Object Reference Style Object

Example

Collapse the table border:

document.getElementById("myTable").style.borderCollapse = "collapse";

Try it yourself »


Definition and Usage

The borderCollapse property sets or returns whether the table border should be collapsed into a single border or not.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The borderCollapse property is supported in all major browsers.


Syntax

Return the borderCollapse property:

object.style.borderCollapse

Set the borderCollapse property:

object.style.borderCollapse="separate|collapse|initial|inherit"

Property Values

Value Description
separate Separate borders are drawn for all table cell elements. This is default
collapse Borders are not drawn between table cell elements
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: separate
Return Value: A String, representing the borders of a table
CSS Version CSS2


More Examples

Example

Return the borderCollapse property:

alert(document.getElementById("myTable").style.borderCollapse);

Try it yourself »


Related Pages

CSS tutorial: CSS Table

CSS reference: border-collapse property


Style Object Reference Style Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook