A webpage can be made through HTML by using different elements and tags. There are several elements which you can add to your webpage. In this blog I will show you how to add a table to your webpage using HTML. A table allows us to arrange and organize data into rows and columns systematically. You can also check out my previous blog which shows how to make a webpage using HTML and how to add emojis in HTML.
Step 1: Adding the border for the table
It is important to give the table a border in order to organize data clearly between cells. In the following screenshot you can see that I added 1px solid black border. This usually goes between the <style> tag
Step 2: Adding the <table> tag
The <table> tag defines a table and is usually placed between the body tag. You can also define the width of the table as shown in the following screenshot
Step 3: Giving the table a caption
You can give the table a heading by using the <caption> tag.
Step 4: Adding the <tr> tag
The <tr> tag defines a row in the table. You can add as many rows you want in the table by using the <tr> tag.
Step 5: Adding the <td> tag
The <td> tag defines a cell in the table. Cells can be grouped horizontally or vertically.
Step 6: Adding more rows
To add more rows you continue with a new <tr> tag as shown in the screenshot below
CODING OUTPUT:
WEB PAGE OUTPUT:
3 thoughts on “How to Create a Table Using HTML”