HTML 5 <table> tag
The <table> tag is used for defining a table in
a HTML document. A HTML tables consist of the <table> element as well as other
table-related elements nested inside the
<table>
tags to determine how the table is constructed.
Lets see the other table-related elements must be, in order:
The <thead> tag
The <thead> tag is used for adding a header to
a table. It is used in conjunction with the <tbody> tag and the <tfoot> tag in
determining each part of the table.
The <tr> tag
The <tr> tag is used for specifying a table row
within a table. A table row contains one or more <td> and/or <th> tags which
determine individual cells/columns.
The <th> tag
The <th> tag is used for specifying a header
cell or table header within a table. This tag must be nested inside a <tr> tag,
which in turn must be nested inside a <table> tag.
The <tfoot> tag
The <tfoot>>
tag is used for adding a footer to a table. It is used in conjunction with the <tbody>
tag and the <thead> tag in determining each part of the table.
The <tbody> tag
The <tbody> tag is used for grouping table
rows. It is used in conjunction with the
<thead> tag and the
<tfoot>
tag in determining each part of the table.
Example
<!DOCTYPE
HTML>
<html>
<body>
<table>
<table
border =
"1">
<thead>
<tr>
<th>Customer
Id</th>
<th>Cus
Name</th>
<th>Cus
Address</th>
<th>Contact
No</th>
</tr>
</thead>
<tfoot>
<tr>
<td>101</td>
<td>Rahul
Kumar</td>
<td>B-108,
XYZ.</td>
<td>222
333</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>102</td>
<td>Amit
Sharma</td>
<td>D-225,
XYZ.</td>
</tr>
<tr>
<td>103</td>
<td>Rekha
Gupta</td>
<td>F-348,
XYZ.</td>
<td>555
111</td>
</tr>
</tbody></table>
</body>
</html>
Output

Note: A more complex HTML table
may also include caption, col, colgroup, thead, tfoot, and tbody elements.