As we know that a table is nothing but a grid of some rows and some columns. Rows are the horizontal divisions whereas columns are the vertical divisions. However in HTML, a table is created in a different way. We don’t create separate columns. Instead, we create rows and then a set of cells in every row.
In HTML, following four fundamental tags are used for creating a table.
Syntax:
Here in this syntactical diagram, you can see that four <tr> tags are coded within one <table> tag.
Every <tr> . . . </tr> creates a row in side of which every <th> . . . </th> or every <td> . . . </td> creates a cell.
We have used an attribute border with <table> tag that creates a border of width 1 pixel. We can change the values to get more thick borders.
The tag <table> has many attributes in HTML, out of which we are discussing some of the most popular ones-
-------
-------
-------
-------
-------
-------
-------
-------
-------
-------
The tag <tr> creates a row in the table. It has following attributes-
-------
-------
-------
-------
-------
-------
The tags <th> or <td> create a cell in the table. These tags have following attributes-
-------
-------
-------
-------