HTMLTableElement: border property

Deprecated

Avoid using this feature in new projects. Some table styling attributes have no effect. They are superseded by CSS. This feature may be a candidate for removal from web standards or browsers.

The HTMLTableElement.border property represents the border width of the <table> element.

Value

A string representing the width of the border in pixels.

Examples

js
// Set the width of a table border to 2 pixels
const t = document.getElementById("TableA");
t.border = "2";

Specifications

Specification
HTML
# dom-table-border

Browser compatibility