asp.net.ph

Skip Navigation Links

TD Element | TD Object

Language References


Denotes a table data cell.HTML 3.2, 4, 4.01, 5

HTML Syntax

Remarks

The TD element specifies a table cell which contain the table data. TD elements can only be used inside table rows, or within a TR element.

Each TD cell normally occupies only one column in one row, though authors can specify how many columns and rows the cell spans by use of the colspan and rowspan attributes.

cellspacing, or the distance between cells, and cellpadding, or the distance between the boundaries of each cell and its contents, are set at the TABLE element level. As such, all cells in a TABLE have the same padding and spacing.

A cell can be empty, that is, the TD element has no content. However, authors must still provide the TD element for any cell that is empty, so as not to collapse the table structure.

An empty cell can be made to behave like other cells in the table, having the same background color, border or other style attribute, by having a non-breaking space for its content, as in <td>&nbsp;</td>. If not, the space occupied by the cell will be completely empty: no content, no background color, and no border.

Although the W3C specifies that TD end tags are optional and may be omitted, it is safer to always close table data cells, as not all browsers support this recommendation, and may produce unexpected results.

Members

TD Members

See Also

TABLE   TH   TR   Using Tables



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note