Definition of HTML td tag
HTML td tag is used in tables to show data cells.
The tag comes with tr tag as a group or singles to show tabular data in rows. Combination of multiple data cells in a row, makes a single data line of the table.
Table of Content
Syntax:
|
1 |
<td>Enter table cell content here...</td> |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<p>List laptop companies:</p> <table> <tr> <th>Sr. No</th> <th>Company Name</th> </tr> <tr> <td>1</td> <td>Apple</td> </tr> <tr> <td>2</td> <td>Asus</td> </tr> <tr> <td>3</td> <td>HP</td> </tr> </table> |
Output
| Sr. No | Company Name |
|---|---|
| 1 | Apple |
| 2 | Asus |
| 3 | HP |
Element Specific Attributes
| Sr. No. | Attribute Name | Description |
|---|---|---|
| 1 | abbr | define the abbreviated content in the table cell.
|
| 2 | align | align the table cells content to a defined location.
|
| 3 | axis | The axis attribute used to define the category of the table cell.
|
| 4 | bgcolor | Define a background color for the cell with the attribute.
|
| 5 | char | This attribute is used only when you specify the value of the align attribute as char (align=”char”). You specify this attribute when you want to specify the character in table cells to align, .
|
| 6 | charoff | Use this attribute only after you specify align=”char”. This defines an alignment offset against the first character with this attribute.
|
| 7 | colspan | A colspan attribute is used in cells to specify the number of columns to merge.
|
| 8 | height | Define the height of the cell with this attribute.
|
| 9 | nowrap | Define this attribute to prevent the automatic wrapping of the cells.
|
| 10 | rowspan | We use this attribute to merge the rows of cells.
|
| 11 | valign | Vertically align the text in the specified location.
|
| 12 | width | This Defines the width of the cell.
|
Resources and References for HTML td tag
See W3C Specification for this tag.
