PUBLISHED ON: FEBRUARY 22, 2021
HTML TD Tag
In HTML, the <td>
stands for table data.
-
The <td>
tag defines a standard cell of a table that contains data.
-
By default, text inside starting and ending <td>
tag is left-aligned and is regular.
HTML <td>
Ttag Syntax and Usage
The <td>
tag requires the start(opening) tag and end(closing) tag.
Following is the syntax for using the <td> tag in your HTML code:
<table>
<tr>
<td>
..content here
</td>
</tr>
</table>
HTML <td>
Tag Attributes
The <td>
tag supports both global and event attributes and some of the common attributes are given below.
1. Colspan
The value of this attribute is a non-negative integer that indicates how many columns the cell extends. Its default value is 1
.
2. Rowspan
The value of this attribute is a non-negative integer that indicates how many columns the cell extends. Its default value is 1
.
3. Header
It is used to specify that one or more header cells a cell relates to.
HTML <td>
Tag Basic Example
Below we have a basic example showing how we use the HTML <td> tag.
Default CSS settings for HTML <td>
Tag
td {
display: table-cell;
vertical-align: inherit;
}
Browser Support for HTML <td>
Tag
Following browsers support this attribute:
-
Google Chrome 6.0+
-
Internet Explorer 9.0+
-
Firefox 4+
-
Opera 11.1+
-
Safari 5.0+