MDN self-hosted library · e01.org

HTMLTableElement: border property

HTML DOM

Open notebook · 1 cells web-api-instance-property upstream source

HTML DOM

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

Value

A string representing the width of the border in pixels.

Examples

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

Specifications

Browser compatibility