Table Border

The HTML Table Border attribute sets the width of Border around the table and table cells. We can set the Border attributes in pixels.

<table border="2">

In the above HTML code we set the Border attribute to 2, this applies a border to each cell, and to the table as a whole. But whatever values you to set in the Border attribute, only the size of the border around the table will change, the border of the table cells remain 1 pixel width.


HTML Source Code :

<html> <body > <table border=5> <tr> <td> January </td> <td> February </td> </tr> <tr> <td> March </td> <td> April </td> </tr> </table> </body> </html>

In the above HTML code we set border=5 , you can see only the Border around the table will change the size to 5 , but cells border inside the table will remain 1 pixel.

HTML Table Bordercolor

The bordercolor attribute will change the color of the border around your table. You can directly type the color names or you can use hexadecimal codes of colors to Boardercolor attribute.

<table border=5 Bordercolor=red>

You can set additional two border color attributes to HTML Table, they are bordercolorlight and bordercolordark attributes. It will give you a 3D effect to your HTML Table.

<table border=5 bordercolorlight=green bordercolordark=blue>

Table with no Border

By default there is no border around HTML Table and Table Cells. If you want to hide (No Border) Border permanently, you can set this property to either 0 or -1 .