File: th.html

package info (click to toggle)
wdg-html-reference 4.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,528 kB
  • ctags: 305
  • sloc: makefile: 39
file content (100 lines) | stat: -rw-r--r-- 11,252 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
   "http://www.w3.org/TR/REC-html40/strict.dtd">
<html lang=en-us>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TH - Table Header Cell</title>
<link rev=Made href="mailto:liam@htmlhelp.com">
<link rel=Start href="../index.html">
<link rel=StyleSheet href="../style.css" type="text/css">
<link rel=StyleSheet href="../aural.css" type="text/css" media=aural>
<meta name="author" content="Liam Quinn">
<meta name="description" content="A description of HTML 4.0's TH element for table header cells.">
<meta name="keywords" content="TH, th element, table cell, header cell, cells, table, tables, HyperText Markup Language, HTML, HTML4, HTML 4.0, Web Design Group, WDG, &lt;th&gt; tag, &lt;TH&gt; tag">
<script type="text/javascript" src="../hideNonStrict.js"></script>
</head>
<body>
<h2><img src="../wdglogo1.gif" width=250 height=83 alt="The Web Design Group"></h2>
<h1>TH - Table Header Cell</h1>
<script type="text/javascript">
<!--
  if (document.styleSheets && writeButton) {
    writeButton("attributes");
  }
// -->
</script>
<table>
  <tr valign=top>
    <th>Syntax</th>
    <td><strong class=required>&lt;TH&gt;</strong>...&lt;/TH&gt;</td>
  </tr>
  <tr valign=top>
    <th>Attribute Specifications</th>
    <td>
      <ul>
        <li>ROWSPAN=<var><a href="../values.html#number">Number</a></var> (rows spanned by the cell)</li>
        <li>COLSPAN=<var><a href="../values.html#number">Number</a></var> (columns spanned by the cell)</li>
        <li>HEADERS=<var><a href="../values.html#idrefs">IDREFS</a></var> (list of header cells for current cell)</li>
        <li>ABBR=<var><a href="../values.html#text">Text</a></var> (abbreviation for header cell)</li>
        <li>SCOPE=[ row | col | rowgroup | colgroup] (cells covered by header cell)</li>
        <li>AXIS=<var><a href="../values.html#cdata">CDATA</a></var> (category of header cell)</li>
        <li>ALIGN=[ left | center | right | justify | char] (horizontal alignment)</li>
        <li>CHAR=<var><a href="../values.html#character">Character</a></var> (alignment character)</li>
        <li>CHAROFF=<var><a href="../values.html#length">Length</a></var> (alignment character offset)</li>
        <li>VALIGN=[ top | middle | bottom | baseline] (vertical alignment)</li>
        <li class=transitional>WIDTH=<var><a href="../values.html#pixels">Pixels</a></var> (cell width)</li>
        <li class=transitional>HEIGHT=<var><a href="../values.html#pixels">Pixels</a></var> (cell height)</li>
        <li class=transitional>NOWRAP (suppress word wrap)</li>
        <li class=transitional>BGCOLOR=<var><a href="../values.html#color">Color</a></var> (cell background color)</li>
        <li><a href="../attrs.html">common attributes</a></li>
      </ul>
    </td>
  </tr>
  <tr valign=top>
    <th>Contents</th>
    <td><a href="../inline.html">Inline elements</a>, <a href="../block.html">block-level elements</a></td>
  </tr>
  <tr valign=top>
    <th>Contained in</th>
    <td><a href="tr.html">TR</a></td>
  </tr>
</table>
<p>The <strong class=html>TH</strong> element defines a <em>header cell</em> in a table. <strong class=html>TH</strong> elements are contained within a <strong class=html><a href="tr.html">TR</a></strong> element (a table row), which may also contain <strong class=html><a href="td.html">TD</a></strong> elements for data cells. When a cell's contents act as both header information and table data, <strong class=html>TD</strong> should be used.</p>
<p>The <strong class=html>ROWSPAN</strong> and <strong class=html>COLSPAN</strong> attributes of <strong class=html>TH</strong> specify the number of rows and the number of columns, respectively, that are spanned by the cell. The default value is <strong class=html>1</strong>. The special value <strong class=html>0</strong> indicates that the cell spans all rows or columns to the end of the table. The value <strong class=html>0</strong> is ignored by most browsers, so authors may wish to calculate the exact number of rows or columns spanned and use that value.</p>
<p>The <strong class=html>HEADERS</strong> attribute specifies the header cells that apply to the <strong class=html>TH</strong>. The value is a space-separated list of the header cells' <strong class=html><a href="../attrs.html#id">ID</a></strong> attribute values. The <strong class=html>HEADERS</strong> attribute allows non-visual browsers to render the header information for a given cell.</p>
<p>The <strong class=html>ABBR</strong> attribute gives an abbreviated version of the cell's content. This allows visual browsers to use the short form if space is limited, and non-visual browsers can give a cell's header information in an abbreviated form before rendering each cell.</p>
<p>The <strong class=html>SCOPE</strong> attribute specifies the cells for which the <strong class=html>TH</strong> element provides header information. <strong class=html>SCOPE</strong> is a simpler alternative to using <strong class=html>HEADERS</strong> if the arrangement of header cells is not complex. Possible values are as follows:</p>
<ul>
  <li><strong class=html>row</strong>, when the <strong class=html>TH</strong> provides header information for the rest of the row;</li>
  <li><strong class=html>col</strong>, when the <strong class=html>TH</strong> provides header information for the rest of the column;</li>
  <li><strong class=html>rowgroup</strong>, when the <strong class=html>TH</strong> gives header information for the rest of the row group (<abbr title="that is"><i lang=la>i.e.</i></abbr>, the remaining cells of the <strong class=html><a href="thead.html">THEAD</a></strong>, <strong class=html><a href="tfoot.html">TFOOT</a></strong>, or <strong class=html><a href="tbody.html">TBODY</a></strong>);</li>
  <li><strong class=html>colgroup</strong>, when the <strong class=html>TH</strong> gives header information for the rest of the column group (<abbr title="that is"><i lang=la>i.e.</i></abbr>, the remaining cells of the <strong class=html><a href="colgroup.html">COLGROUP</a></strong>).</li>
</ul>
<p>The <strong class=html>AXIS</strong> attribute provides a method of categorizing cells. The attribute's value is a comma-separated list of category names. See the <a href="http://www.w3.org/TR/REC-html40/">HTML4.0 Recommendation</a>'s section on <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#multi-dimension">categorizing cells</a> for an application of <strong class=html>AXIS</strong>.</p>
<p>In addition to the <a href="../attrs.html">attributes common to most elements</a>, <strong class=html>TH</strong> takes a number of presentational attributes. <a href="../../css/index.html">Style sheets</a> provide a more flexible way to suggest a presentation for table cells, but <strong class=html>TH</strong>'s presentational attributes are more widely supported by current browsers.</p>
<p>The <strong class=html>ALIGN</strong> attribute specifies the horizontal alignment for the cell. Possible values are <strong class=html>left</strong>, <strong class=html>center</strong>, <strong class=html>right</strong>, <strong class=html>justify</strong>, and <strong class=html>char</strong>. <strong class=html>ALIGN=char</strong>, poorly supported among browsers, aligns a cell's contents on the character given in the <strong class=html>CHAR</strong> attribute. The default value for the <strong class=html>CHAR</strong> attribute is the decimal point of the current language--a period in English. The <strong class=html>CHAROFF</strong> attribute specifies the offset to the first occurrence of the alignment character. The attribute's value is a number in pixels or a percentage of the cell's width; <strong class=html>CHAROFF="50%"</strong> centers the alignment character horizontally in a cell.</p>
<p>The <strong class=html>VALIGN</strong> attribute specifies the vertical position of a cell's contents. Possible values are:</p>
<ul>
  <li><strong class=html>top</strong>, which positions data at the top of the cell;
  <li><strong class=html>middle</strong>, the default value, which centers the cell data vertically;
  <li><strong class=html>bottom</strong>, which positions data at the bottom of the cell;
  <li><strong class=html>baseline</strong>, which specifies that the first line of each cell in the row with <strong class=html>VALIGN=baseline</strong> should occur on a common baseline.</li>
</ul>
<div class=transitional>
<p>The <strong class=html>WIDTH</strong>, <strong class=html>HEIGHT</strong>, <strong class=html>NOWRAP</strong>, and <strong class=html>BGCOLOR</strong> attributes are all <a href="../deprecated.html">deprecated</a> in favor of <a href="../../css/index.html">style sheets</a>. <strong class=html>WIDTH</strong> and <strong class=html>HEIGHT</strong> suggest the cell's width and height in pixels. The boolean <strong class=html>NOWRAP</strong> attribute tells visual browsers to disable word wrap for the cell, which can result in unnecessary horizontal scrolling depending on the user's window width and font size.</p>
<p>The <strong class=html>BGCOLOR</strong> attribute suggests a background color for the cell. The combination of this attribute with <strong class=html>&lt;<a href="../special/font.html">FONT</a> COLOR=<var>...</var>&gt;</strong> can leave invisible or unreadable text on Netscape Navigator 2.<var>x</var>, which does not support <strong class=html>BGCOLOR</strong> on table elements. <strong class=html>BGCOLOR</strong> is dangerous even on supporting browsers, since most fail to override it when overriding other author-specified colors. <a href="../../css/index.html">Style sheets</a> provide a safer, more flexible method of specifying a table's background color.</p>
</div>
<h2>More Information</h2>
<ul>
  <li><a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TH">TH in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTML4.0 Recommendation</a></li>
  <li><a href="http://www.w3.org/TR/REC-html32#table">TH in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTML3.2 Recommendation</a></li>
  <li><a href="../../wilbur/table/th.html">TH in <abbr class=initialism title="Web Design Group">WDG</abbr> HTML3.2 Reference</a></li>
  <li><a href="http://www.malibutelecom.com/yucca/HTML3.2/5.57.html">TH in <cite>Learning HTML3.2 by Examples</cite></a></li>
</ul>
<div class=footer>
<address>Maintained by <a href="http://www.htmlhelp.com/%7Eliam/">Liam Quinn</a> &lt;<a href="mailto:liam@htmlhelp.com">liam@htmlhelp.com</a>&gt;</address>
<p class=toolbar><img src="../wdglogo-small.gif" width=105 height=40 alt="Web Design Group ~"> <a href="../index.html" rel=Start>HTML4.0Reference</a>~ <a href="../olist.html">ElementsbyFunction</a>~ <a href="../alist.html">ElementsAlphabetically</a></p>
<p class=copyright>Copyright &copy; 1998 by <a href="http://www.htmlhelp.com/%7Eliam/">Liam Quinn</a>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <a href="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</a>).</p>
</div>
</body>
</html>