1. Computing & Technology

Discuss in my forum

<td></td>

By , About.com Guide

TD description:

The TD tag defines table cells.

TD Web Browser Support:

HTML Versions

TD Attributes:

Global attributes, event attributes and:

TD End Tag:

</td> optional in HTML 4.0. Required in XHTML.

Contents:

CDATA Usually text. The following tags are valid within the TD tag:
a, abbr, acronym, address, applet, b, bdo, big, blockquote, br, button, center, cite, code, dfn, dir, div, dl, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i, iframe, img, input, isindex, kbd, label, map, menu, noframes, noscript, object, ol, p, pre, q, s, samp, script, select, small, span, strike, strong, sub, sup, table, textarea, tt, u, ul, var

TD Valid Context:

The TD tag is valid within the following tags:
tr

TD Usage:

basic html table with 2 table cells

<table border width="200">
  <tr>
    <th>header cell 1</th>
    <th>header cell 2</th>
  </tr>
  <tr>
    <td>cell 3</td>
    <td>cell 4</td>
  </tr>
</table>

TD Special Notes:

  • While you can omit the ending tag in HTML, tables are easier to read when they are present, and it gives you better control over style tags.
  • When using nested tables, if the td tags are not closed, the browsers may become confused as to which table elements go with which table.

More TD Information:

©2012 About.com. All rights reserved.

A part of The New York Times Company.