HOW TO Add Table To Your HTML

HOW TO Add Table To Your HTML

•Introduction

• What is a Table in HTML?

•The Syntax

• Conclusion

Introduction

When making a project that needs to show data visually, you will need a good way to display the information so it's easy to understand by the users.

Depending on the type of data, you can choose between different representation methods using HTML elements.

In many situation, tables are more easier to display large amounts of constructed data nicely. So, in this article, we are going to learn how to use tables in HTML.

What is a Table in HTML?

A table is a visualization of data organized in columns and in rows. With the help of tables in HTML, you can arrange data like texts, images, links and many others into rows and columns of cells.

Tags are used in creating tables. The most important one is the

tag which is the main container of the table. It shows where the table will begin and where it ends.

Common HTML Table tags Other tags include:

<tr> - the tr represents rows and it is also known as table rows
<td> - table data is used to create data cells
<th> - table headingsvused to add table headings, it helps to know what the table will contain
<caption> - it used to insert captions
<thead> - it is use to add a separate header to the table
<tbody> - shows the major body of the table
<tfoot> - creates a separate footer for the table

The Syntax

<table> <tr> <td>Cell 1</td> <td>Cell 2</td> <td>Cell 3</td> </tr> <tr> <td>Cell 4</td> <td>Cell 5</td> <td>Cell 6</td> </tr> </table>
And the output will be:

Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

Conclusion

Do you want to know how to style your table, stay tuned to my blog!