Td Tag in HTML5

In this article i am going to describe about the implementation and use of Td Tag in HTML5.
  • 2069

<Td> Tag in HTML5

The HTML <td> tag is used for specifying a cell (or table data) within a table. The <td> tag is used within the <tr> tag. This tag must have opening and closing tags.

An HTML table has two kinds of cells:

  1. Header cells - contains header information (created with <th> element)
  2. Standard cells - contains data (created with the <td> element)

By default, the text in <th> elements are bold and centered while the text in <td> elements are regular and left-aligned.

Syntax

<table border = "Value">
<tr>
<td>Text</td>
</tr>
</table>
Browser Support
It is supported in all major browsers.
Attributes supported by <td> Tag
   Attribute     Value              Description
  colspan   number defines the total number of columns,the cell should span.
  headers   header_id Specifies one or more header cells a cell is related to
  rowspan   number defines the total number of rows,the cell should span.

Some of the attributes of HTML4.01( suchas abbr, align, axis,char, charoff, height, nowrap, scope, valign, width) are not supported in HTML5.

Example of <td> tag in HTML5

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta charset="utf-8" />

    <title>Td Tag in HTML5</title>

</head>

<body>

    <h3>Implementation Of &lt;td&gt;Tag in HTML5</h3>

    <table border="1">

        <tr>

            <td>Sachin</td>

            <td>Tendulkar</td>

        </tr>

        <tr>

            <td>Rahul</td>

            <td>Dravid</td>

        </tr>

        <tr>

            <td>Sorav</td>

            <td>Ganguly</td>

        </tr>

</body>

</html>

Output

td.jpg

© 2020 DotNetHeaven. All rights reserved.