HTML table border attribute | .com
Learn not just technology, but also dreams!
HTML <table> border attribute
Example
The following HTML table will display borders around the table cells:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Browsers Support
All major browsers support the border attribute.
Definition and Usage
The border attribute specifies whether borders should be displayed around table cells.
A value of "1" indicates that borders should be shown, and the table is not intended for layout purposes.
table element should use CSS to define styles. 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 only used to indicate whether a table is used for layout purposes, and only allows the values "" or "1".
Syntax
<table border="1">
Attribute Values
| Value | Description |
|---|---|
"" |
No border around table cells (the table can be used for layout purposes). |
"1" |
Adds a border around table cells (the table is not used for layout purposes). |
Related Tags
<table>tag<tbody>tag<sup>tag
Recommended Plans
Byte Ark Coding Plan
Supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax. Official direct supply, stable and reliable.
Xunfei Xingchen Coding Plan
Includes free model call quotas. Supports DeepSeek, GLM, Kimi, MiniMax. One-stop platform for experience and deployment.
Category Navigation
Python / Data Science
AI / Intelligent Development
Frontend Development
Backend Development
Database
Mobile Development
DevOps / Engineering
Programming Languages
Computer Fundamentals
XML / Web Service
.NET
Website Construction
Quick Links
- HTML Tags (Alphabetical)
- HTML Tags (Alphabetical)
- HTML Tags (Functional)
- Global Attributes
- Events
- Canvas
- Audio/Video
- Valid DOCTYPES
- Color Names
- Color Picker
- Color Mixing
- Emoji
- Character Sets
- ASCII
- ISO-8859-1
- Symbols
- URL Encoding
- Language Codes
- Country/Region Codes
- HTTP Messages
- HTTP Methods
- Px/Em Converter
- Keyboard Shortcuts
- HTML Tags
Online Examples
Character Sets & Tools
Latest Updates
Site Information
Follow us on WeChat
YouTip