Table of Contents
Introduction
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:
Syntax
Here we have use these tags:
Tag | Meaning | Description |
<table>…</table> | HTML Table tag | It defines the starting and ending of table |
<tr>…</tr> | Row tag | It adds rows within the table |
<td>…</td> | Column tag | It adds columns within the row |
<th>…</th> | Header tag | It adds headers within the row |
Example
Output
Note: You might be missing table border here. Table border comes under CSS section, which will be covered later.
0 Comments