Create a table using Border Attribute
1 Open Notepad
2 Copy code and past in Notepad
<!DOCTYPE html>
<html>
<body>
<table border="4" bordercolor="red">
<tr>
<th>Student Name</th>
<th>Roll Number</th>
</tr>
<tr>
<td>Vinod</td>
<td>01</td>
</tr>
<tr>
</table>
<html>
<body>
<table border="4" bordercolor="red">
<tr>
<th>Student Name</th>
<th>Roll Number</th>
</tr>
<tr>
<td>Vinod</td>
<td>01</td>
</tr>
<tr>
</table>
<caption> Student Record </caption>
</body>
</html>
</body>
</html>
Output:
Student Name | Roll Number |
---|---|
Vinod | 01 |
Note:
Show the border in table use border attribute . It takes the size of the border as its value.
To define a different color of border than black, bordercolor attribute is used.
To define a different color of border than black, bordercolor attribute is used.