Press "Enter" to skip to content

tableBORDERCOLOR

HTML Table Bordercolor

The HTML table bordercolor attribute is used to specify the color of the border around a table. It is an older HTML attribute that is not recommended for use in modern web development, as it is considered to be deprecated.

Here’s an example of how to use the bordercolor attribute:

<table border="1" bordercolor="#ff0000">
  <tr>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
  </tr>
  <tr>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>
  </tr>
</table>

In this example, the bordercolor attribute is set to “#ff0000”, which specifies a red border around the table. The border attribute is also set to “1”, which specifies the thickness of the border.

However, it is important to note that the bordercolor attribute is no longer recommended for use in modern web development. Instead, it is recommended to use CSS to style the border of a table. Here’s an example of how to use CSS to style the border of a table:

<style>
  table {
    border: 1px solid #ff0000;
  }
</style>
<table>
  <tr>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
  </tr>
  <tr>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>
  </tr>
</table>

In this example, CSS is used to set the border of the table to 1 pixel thickness and a solid red color.

In summary, the bordercolor attribute is an older HTML attribute that is used to specify the color of the border around a table. While it is still supported in modern web browsers, it is no longer recommended for use in favor of using CSS to style the border of a table.