HTML Tables allow web developers to arrange their text, data, images, link in form of row and columns.
<table> tag is used to create table in html. <tr> tag is used inside table tag for making a row cell. <td> tag is placed inside tr tag and is used for each data cell.
For creating separate head body and footers in table we can use three different tags.
<table> tag is used to create table in html. <tr> tag is used inside table tag for making a row cell. <td> tag is placed inside tr tag and is used for each data cell.
For creating separate head body and footers in table we can use three different tags.
- <thead> - for table header.
- <tbody> - for body of the table.
- <tfoot> - for table footer.
Cell Padding and cell spacing are used for giving white spaces in table. Border of the table can also be changed using the border attribute of the table.
<html>
<head>
<title>HTML TABLES</title>
</head>
<body>
<table border="3px" cellpadding="5" cellspacing="5">
<tr>
<th>Name</th>
<th>Age</th>
<th>Salary</th>
</tr>
<tr>
<td>Employee 1</td>
<td>50</td>
<td>10000</td>
</tr>
<tr>
<td>Employee 2</td>
<td>7000</td>
<td>20000</td>
</tr>
</table>
</body>
</html>
No comments:
Post a Comment