How to make a table in Html
Sometimes, there’s a need to put data into tables so it can be demonstrated easily to your web visitors. If you want to put tables with figures or images on your website, here are the simple steps that can help you:
1. Inside the <body> </body> tags of the html page, add the <table> </table> tags.
The <table> tag indicates the start of the table you’re creating and the </table> tag ends it.
2. Set the border of your table, if you want one. In the example below, the border size is 1. You can increase the size of the border as desired.
<table border=”1″>
3. The first row of the table is determined by the <tr> tag. The number of your <tr> tags determines the number of rows you have in the table. This tag should be closed by the </tr> code.
4. Under each <tr> tag, you can now define the content or the data to be shown using the <td> tag. This now determines the columns or cells in your table. Close it accordingly with the corresponding </td> tag.
5. Make as many rows and columns you wish, and end your table with the </table> tag.
Here’s an example:
<table border=”1″>
<tr>
<td>Row 1 Column 1</td>
<td>Row 1 Column 2</td>
</tr>
<tr>
<td>Row 2 Column 1</td>
<td>Row 2 Column 2</td>
</tr>
</table>
So when you put this code into a html editor or your index source, it will look like this:
| Row 1 Column 1 | Row 1 Column 2 |
| Row 2 Column 1 | Row 2 Column 2 |
And that is how you create a table in html.