HTML Table Border
From w3cyberlearnings
Contents |
HTML Border
Create Table Border by using border attribute or CSS.
Note
Use border attribute to define the table border is obsoleted. Please use CSS instead.
Example 1 TRY-IT
we use border attribute to set the thickness of the border, and we use the bordercolor to set the border color respectively.
<table border="1" bordercolor="green"> <tr> <td>First</td> <td>Second</td> <td>Third</td> <td>Four</td> <td>Five</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> </tr> </table>
Example 2 TRY-IT
We define the table color by using the CSS.
<style> table,th,td { border:2px solid red; } </style>
Example 3 TRY-IT
<style> table{ border:2px solid red; } td { border:1px solid blue; } </style>
Example 4 TRY-IT
<style> table{ border:2px solid red; } .bluec { border:1px solid blue; } </style>
Related Link
Table
- HTML - Table
- HTML - Table Border
- HTML - Table Column
- HTML - Table Row
- HTML - Table Color
- HTML - Table Cell Spacing and Padding
- HTML - Text Align
- HTML - Text Vertical Align
- HTML - Table Caption and Summary
- HTML - Table thead, tbody, tfoot
- HTML - Inner Table
- HTML - Table Vertical Line
- HTML - Table Horizontal Line