HTML border attribute

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


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

border attribute value

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.

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

border using CSS

Now CSS properties are used to define the borders for the table, td and th elements. The table can be styled completely using css properties.


Name Roll no Grade
Albert 50 A
Merie 55 B
Abraham 56 A+
Try </>

Related Tags

The tags that support border attribute are given below.

<table> tag

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

Related Pages

You can visit these pages.

table represents data in the form of columns and rows.

tr means table row.

th stands for cell table heading.

td defines a cell of data.

Was this article helpful?




Get the newsletter