1. Computing & Technology

Discuss in my forum

<th></th>

By , About.com Guide

TH description:

The TH tag defines the contents of table header cells. Most browsers make TH cells centered and bold. So if you don’t want those styles you should reset the TH tag in your style sheet.

TH Web Browser Support:

HTML Versions

TH Attributes:

Global attributes, event attributes and:

TH End Tag:

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

Contents:

CDATA Usually text. The following tags are valid within the TH 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

TH Valid Context:

The TH tag is valid within the following tags:
tr

TH 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>

TH Special Notes:

  • The default look and feel of a header cell is usually centered with bold text.
  • While you can omit the ending tag, tables are easier to read when they are present, and it gives you better control over style tags.
  • When using nested tables, if the TH tags are not closed, the browsers may become confused as to which table elements go with which table.

More TH Information:

©2012 About.com. All rights reserved.

A part of The New York Times Company.