Table is one of the elements in HTML that we can use to create tables in our web pages.
table element consists of some tags and attributes necessary to build a table. Those tags are as follows:
<td>: defines a standard data cell in an HTML table.
<tr>: defines a row in an HTML table.
<th>: defines a header cell in an HTML table.
As shown in the illustration above, a
<table> tag uses multiple elements to create a simple table in HTML. The following syntax shows how to create a table with three rows and one element in each row.
<table> <tr> <th>....</th> </tr> <tr> <td>...</td> </tr> <tr> <td>...</td> </tr> </table>
Consider the following example code that demonstrates how to create a table in HTML.
In the implementation above, we have made three data entries using the
Billy), along with their respective ages.
<th> tag creates headings for
Age. Both the
<td> tags are included inside the
<tr> tag to group them in a single row.
View all Courses