HTML table Tag
HTML table allows us to represent the data in row and column form.
Define an HTML Table
<table> tag is used to create table along with <tr>, <td> and <th> for table rows, columns and header respectively.
<table> tag attributes:
caption : This is used to give a name to the table. e.g. <caption>My Table</caption>
border : This attribute is used to give the border to the table. It has values in pixels.
bordercolor : This is used to give the color to the border. e.g. bordercolor="color_name"
align : This is used to set the alignment of the table i.e. left, right and center.
Example:
<table border="2" bordercolor="red" align="center">
<caption>Students</caption>>
<tr>
<th>S.No.</th>
<th>Name</th>
</tr>
<tr>
<td>1.</td>
<td>Rohit</td>
</tr>
<tr>
<td>2.</td>
<td>Suman</td>
</tr>
</table>
Output :
S.No. | Name |
---|---|
1. | Rohit |
2. | Suman |
YouTube video link:
Comments
Post a Comment