HTML Table


In real world applications, tables are widely used to display organization data. In HTML too we can create our own Table with columns, headers and rows. With the help of query functions in JavaScript we can even add rows and columns to these tables at runtime.

Tables in HTML

To display table in HTML we use <table> tag. For each row we use <tr> tag [tr stands for table row] and for each header and column we use <th> [table “” not found /]
and <td> [table “” not found /]
tag respectively. This can be easily understood by given syntax and example:


HTML Table Syntax

Here we have use these tags:

<table>…</table>HTML Table tagIt defines the starting and ending of table
<tr>…</tr>Row tagIt adds rows within the table
<td>…</td>Column tagIt adds columns within the row
<th>…</th>Header tagIt adds headers within the row


HTML Table Example


HTML Table Output

Note: You might be missing table border here. Table border comes under CSS section, which will be covered later.


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.