HTML border attribute

HTML border attributes represents the border of the table to make it presentable.

<table border="1">
  <tr> <th>Name</th> <th>Roll no</th> </tr>
  <tr> <td>Albert</td> <td>50</td> </tr>	
  <tr> <td>Merie</td> <td>55</td> </tr>	
  <tr> <td>Abraham</td> <td>56</td> </tr>	
Name Roll no
Albert 50
Merie 55
Abraham 56

Attribute values

All possible values of border attribute

The value of this attribute is a valid positive integer (1,2,3...). For example, the following example represents a thick border for the table.


Name Roll no Project
Albert 50 complete
Merie 55 uncomplete
Abraham 56 complete
Try </>

In the above example, the value of border attribute is 5.

Related Tags

The tags that support border attribute

<table> tag

table tag represents the data in the form of rows and columns. It supports the border attribute.

Although border attribute is used in the <border> tag but border also applies to the <td> tag.

Was this article helpful?