How to create table in HTML?

How to create table in HTML?
HTML tags are easy to use and learn. I explained about creating table in HTML in this article.

There are following tags for creating tables.
table
tr
td
th
tbody
thead
tfoot

here is the example of creating table.

[ad#200x90]
<table align=”center” border=”1″ width=”100%”>
<thead>
<tr><th colspan=”2″>This is header</th></tr>
</thead>
<tfoot>
<tr><td colspan=”2″>This is footer</td></tr>
</tfoot>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
This is header
This is footer
Cell 1 Cell 2
Cell 3 Cell 4

Explanation:

<table> is a main tag. it is for starting table.

<thead> is for header of table.

<tr> stands for Table Row. Row is started.

<th> stands for Table Heading. You can see heading “This is header” in thead section.

<td> stands for Table Data or Table Cell.

<tfoot> is used for bottom section or footer for table.

<tbody> is middle portion of table between thead and tfoot.