Easy Tutorial
❮ Html Elements Ev Onmousedown ❯

HTML <table> border Attribute

HTML <table> Tag

Example

The following HTML table will display borders around table cells:


Browser Support

All major browsers support the border attribute.


Definition and Usage

The border attribute specifies whether a border should be displayed around table cells.

The value "1" indicates that a border should be displayed, and the table is not used for layout purposes.

Note: This attribute is deprecated. The table element should use CSS for styling. CSS properties border, border-color, border-width, and border-style can achieve the same effect.


Differences Between HTML 4.01 and HTML5

In HTML5, the border attribute is only used to indicate whether the table is used for layout purposes, and only allows the attribute values "" or "1".


Syntax

Attribute Values

Value Description
"" No border around table cells (table can be used for layout purposes).
"1" Adds a border around table cells (table is not used for layout purposes).

❮ Html Elements Ev Onmousedown ❯