A glimpse of HTML Tables

A glimpse of HTML Tables

Table of contents

No heading

No headings in the article.

Have you ever thought about how tables are created🤔? How are the values added to tables?

In today's blog, we'll take a glimpse on the topic.

Let's look at the tags used in making a table-

  • <tr>
  • <th>
  • <td>

Look at the example below to understand these table tags👇.

<table>
    <caption> Stationary </caption>
    <tr>
        <th> Pens </th>
        <th> Pencil </th>
        <th> Eraser </th> 
        <th>Register </th> 
    </tr>

    <tr>
        <td> Blue </td>
        <td> Doms</td>
        <td> Natraj </td>
        <td> Classmate </td> 

    </tr>
</table>

We get the following output.

Stationary
Pens Pencil Eraser Register
Blue Doms Natraj Classmate

Explanation

  • <table> - Table tag creates a table.
  • <caption>- It indicates the name of the table.
  • <tr> - It represents the row in a table.
  • <th> - It gives the information about the column name.
  • <td> - It is used to add data to a table.

Want to know more about HTML tables? Stay tuned!!