html tutorial - border Attribute in HTML - html5 - html code - html form

Learn html - html tutorial - Border attribute in html - html examples - html programs
- The border attribute specifies the border of the table.
- The border is an integer attribute defines in pixel to display the border around the table.
Syntax for border attribute in HTML:
<table border=”value”
Differences between HTML 4.01 and HTML5 for border attribute:
HTML 4.01
- HTML4 support border attribute.
HTML 5
- HTML5 does not support border attribute.
Applies To:
Elements | Attribute |
---|---|
<table> | border |
Attribute Values:
Value | Description |
---|---|
0 | No borders around the table cells. |
1 | Add borders around the table cells. |
number | To specify the size of the frame surrounding the table. |
Sample Coding for border Attribute in HTML:
Tryit<!DOCTYPE html>
<html>
<body>
<table border="2">
<tr>
<th>Technology</th>
<th>language</th>
</tr>
<tr>
<th>HTML</th>
<th>Markup lang</th>
</tr>
<tr>
<th>JavaScript</th>
<th>Scripting lang</th>
</tr>
</table>
</body>
</html>
Code Explanation for border Attribute in HTML:

- The border attribute is declare the border with value 2 for the table.
Output for border Attribute in HTML:

- The output displays the table with border in the HTML page.
Browser Support for border Attribute in HTML:
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes |