Table Tags in HTML

 Table tags basically used for creating tables in webpage.

The tags used for creating table

<table> - enclosing all table realted datas inside the tag.
  • <tr> - This will create rows in table.
  • <th> - It is used for creating heading .
  • <td>- It is used for providing datas and columns.

Example:

Let us create an tables using school time table.
  • Create a table tag <table> and enclose them.
  • Inside the table create a row using <tr> .
  • Create a colums inside the row usinf <th> or <td>.
  • For headings use <th>.

Code for creating:

<!DOCTYPE html>
<html lang="en">

<head>
    <title>table tags</title>
</head>

<body>
    <table border="1">
        <tr>
            <th>Day</th>
            <th>10am-11am</th>
            <th>11am-12pm</th>
            <th>1pm-2pm</th>
        </tr>
        <tr>
            <td>Monday</td>
            <td>Physics</td>
            <td>Maths</td>
            <td>Tamil</td>
        </tr>
        <tr>
            <td>Tuesday</td>
            <td>Zoology</td>
            <td>Botany</td>
            <td>Chemistry</td>
        </tr>
        <tr>
            <td>Wednesday</td>
            <td>Tamil</td>
            <td>English</td>
            <td>Botany</td>
        </tr>
        <tr>
            <td>Thursday</td>
            <td>Physics</td>
            <td>Maths</td>
            <td>English</td>
        </tr>
        <tr>
            <td>Friday</td>
            <td>Science</td>
            <td>Maths</td>
            <td>Biology</td>
        </tr>

    </table>
</body>

</html>

Output:



Table Tags

Table tags

Post a Comment

Post a Comment (0)

Previous Post Next Post