HTML
Example
The following HTML table will display borders around the table cells:
| Month | Savings |
|---|---|
| January | $100 |
| February | $80 |
Try it »
Browser support





All major browsers support the border attribute.
Definition and Usage
The border attribute specifies whether borders are displayed around the table cells.
The value "1" indicates that borders should be displayed and that the table is not used for layout purposes.
Note: This attribute is deprecated; the table element should be styled with CSS. The 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 used only to indicate whether the table is used for layout purposes, and only the values "" or "1" are allowed.
Syntax
Attribute values
| Value | Description |
|---|---|
| "" | No borders around the table cells (the table can be used for layout purposes). |
| "1" | Add borders around the table cells (the table is not used for layout purposes). |
HTML