HTML Table

by | Jun 13, 2020 | Website Development

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

HTML Table 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

HTML Table Example

Output

HTML Table Output

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

 

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

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