HTML td tag

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

<table class="demoTable">


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

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.

Tag omission

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

Global Attributes

All global attributes are applicable on the td element.

Tag Attributes

Attributes that are applicable to <td> tag

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>

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?