Pr.Pg Next Pg

<TD>..</TD> tag tutorials

  • This is a paired tag. It requires opening and closing tags.

  • This stands for Table Data. This element specifies a data cell in a table. The element should occur within a table row as defined by the tr element.

  • Attributes of <TD> are listed below :

WIDTH = No of Pixel or Screen%

HEIGHT = No of Pixel or Screen%

ALIGN = LEFT/RIGHT/CENTER

BGCOLOR = COLOR NAME or hexadecimal code

COLSPAN=No of Columns or Cell

ROWSPAN=No of Rows or Cell in vertical direction.

 

Sr No

Attributes

Descriptions

1

WIDTH

Sets the Width of the table cell

2

HEIGHT

Sets the Height of the table cell

3

ALIGN

Sets the Position of text inside table cell

4

BGCOLOR

Sets the background color of table cell

5

COLSPAN

Merge the table cell.

6

ROWSPAN

Merge the table cell in vertical direction.

 

  • The TD tag is supported in all major browsers like Chrome,Firefox, Opera, Safari, Internet Explorer

Syntax:

<body

<table>

<tr><td>column data or some html tag</td></tr>

</body>

 

Example: HTML Program to demonstrate TD and its attribute

Output:
Example: HTML program to demonstrate table rows attributes TR

Output:
Example: HTML program to demonstrate colspan

Output:
Pr.Pg border                                              Next Pg