HTML Table Border Color Attribute

In this tutorial we will see how to change the border color of table using bordercolor attribute. We have already learnt to change the background color, now with border color you will have more options to add more colors in the table to make it looks good.

As always we will see an HTML code which will change the border color of the table.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  How to change the border color of table
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="2" bordercolor="red">
   9:  <tr>
  10:  <td>
  11:  Student Name
  12:  </td>
  13:  <td>
  14:  Student Marks
  15:  </td>
  16:  </tr>
  17:  <tr>
  18:  <td>
  19:  Adam
  20:  </td>
  21:  <td>
  22:  80
  23:  </td>
  24:  </tr>
  25:  </table>
  26:  </body>
  27:  <html>

Open the html file in browser to see the table with red border color.


However, the bordercolor attribute is depreciated now the preferred method to change border color using the CSS style border-color property.

<table border="2" style="border-color:red">

Tags: , , , , , , ,

Author: Revo

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *

one + 1 =


Pin It on Pinterest

Share This