HTML td tag

html <td> tag represents a cell of data in a table. The data is placed in these cells.

Example

Countries Population Area
China 7,432,663,275 9,572,900
Indonesia 260,581,100 1,904,556
Try </>

In the above example, the table has three rows. And each row has three data cells.

Here the caption element defines the title or context of the table.

Related tags

TagsDescription
<table> represents data in a table in the form of rows and columns.
<table> structured data </table>
<tr> represents table rows in a table.
<table> <tr> a row </tr> </table>
<th> represents a cell of data in a table.
<table> <tr><th> a cell of data </th></tr> </table>

Global Attributes

All global attributes are applicable on the td element.

Tag omission

End tag (<td>) element may be omitted.

Specific Attributes

AttributesDescription
rowspan spans more than one rows for table data cell.
<table> <tr><td rowspan="no of rows to span"> a cell of data </td></tr> </table>
colspan spans more than one columns for table data cell.
<table> <tr><td colspan="no of columns to span"> a cell of data </td></tr> </table>


Was this article helpful?

 

Email:

Message:

Get the newsletter