File: table.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 (127 lines) | stat: -rw-r--r-- 6,091 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<!-- Thanks for reading the source of this document. Hope you enjoy -->
<!-- what you find here. Please let me know if you find any errors. -->
<HEAD>
<TITLE>TABLE - HTML Tables</TITLE>
<META NAME="description" CONTENT="Wilbur is the name for the next HTML standard (3.2). Here you can find all the tags in this proposal, including tips on usage and limitations.">
<META NAME="keywords" CONTENT="html authoring, reference, wilbur, tag overview">
<META NAME="generator" CONTENT="Orb v1.3 for OS/2">
<META NAME="author" CONTENT="Arnoud Engelfriet">
<LINK REV="made" HREF="mailto:galactus@htmlhelp.com" TITLE="Wilbur feedback">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"
ALINK="#000080">
<H1 ALIGN=CENTER>TABLE - HTML Tables</H1>

<TABLE>
<TR>
<TH VALIGN=TOP ALIGN=LEFT><B>Appearance:</B></TH> 
<TD VALIGN=TOP>&lt;TABLE&gt; &lt;/TABLE&gt;<BR></TD>
</TR>
<TR>
<TH VALIGN=TOP ALIGN=LEFT><B>Attributes:</B></TH> 
<TD VALIGN=TOP>ALIGN=left|center|right, WIDTH=<CODE>n</CODE>|<CODE>p%</CODE>, BORDER=<CODE>n</CODE>, CELLSPACING=<CODE>n</CODE>, CELLPADDING=<CODE>n</CODE><BR></TD>
</TR>
<TR>
<TH VALIGN=TOP ALIGN=LEFT><B>Contents:</B></TH> 
<TD VALIGN=TOP>One <A HREF="../table/caption.html">CAPTION</A>, <A HREF="../table/tr.html">TR</A>.<BR></TD>
</TR>
<TR>
<TH VALIGN=TOP ALIGN=LEFT><B>May occur in:</B></TH> 
<TD VALIGN=TOP><A HREF="../body/body.html">BODY</A>, <A HREF="../block/div.html">DIV</A>, <A HREF="../block/center.html">CENTER</A>, <A HREF="../block/blockquote.html">BLOCKQUOTE</A>, <A HREF="../block/form.html">FORM</A>, <A HREF="../table/th.html">TH</A>, <A HREF="../table/td.html">TD</A> and <A HREF="../list/dd.html">DD</A>, <A HREF="../list/li.html">LI</A>.<BR></TD>
</TR>
</TABLE>

<P>
Table start with an optional caption followed by one or more rows. Each
row consists of one or more cells, which can be either header or data 
cells. Cells can overlap across rows and columns.
<P>
The ALIGN attribute controls the alignment of the table itself, but
not of the individual cells. This can be set either in the <A HREF="../table/tr.html">TR</A>
element for an entire row, or in the <A HREF="../table/td.html">TD</A> and <A HREF="../table/th.html">TH</A> elements for
individual cells. The WIDTH attribute can be a pixel width or a
percentage. It indicates the suggested width of the table, although
the browser can ignore this if it is not possible. A "100%" value
means the table will span across the entire browser window.
<P>
You can specify the width of the border around the table with the BORDER
attribute. This attribute only affects the width of that border, not of
the lines between table cells. If the attribute is omitted, no border
will be drawn.
<P>
However, you can increase the whitespace inside a table. The CELLPADDING
attribute indicates how many pixels there should be between a cell's
contents and the border. CELLSPACING indicates how much whitespace
(in pixels) there should be between individual cells.
<P>
As an example, here is a table from the HTML 3.0 draft:
<PRE>
&lt;TABLE BORDER=1&gt;
  &lt;CAPTION&gt;A test table with merged cells&lt;/CAPTION&gt;
  &lt;TR&gt;&lt;TH ROWSPAN=2&gt;&lt;TH COLSPAN=2&gt;Average
  &lt;TH ROWSPAN=2&gt;other&lt;BR&gt;category&lt;TH&gt;Misc
  &lt;TR&gt;&lt;TH&gt;height&lt;TH&gt;weight
  &lt;TR&gt;&lt;TH ALIGN=LEFT&gt;males&lt;TD&gt;1.9&lt;TD&gt;0.003
  &lt;TR&gt;&lt;TH ALIGN=LEFT ROWSPAN=2&gt;females&lt;TD&gt;1.7&lt;TD&gt;0.002
&lt;/TABLE&gt;
</PRE>
<P>
This could appear as follows, in a text browser:
<PRE>
          A test table with merged cells
/--------------------------------------------------\ 
|          |      Average      |  other   |  Misc  |
|          |-------------------| category |--------|
|          |  height |  weight |          |        |
|-----------------------------------------|--------|
| males    |   1.9   |  0.003  |          |        |
|-----------------------------------------|--------|
| females  |   1.7   |  0.002  |          |        |
\--------------------------------------------------/
</PRE>

  <H2>Notes:</H2>
<UL>

<LI>Some browsers (in particular, all versions of Netscape) do not
honor the ALIGN attribute on a table. For these browsers, enclose
the entire table in a <A HREF="../block/center.html">CENTER</A> or &lt;<A HREF="../block/div.html">DIV</A> ALIGN=CENTER&gt; tag.
<LI>Avoid using pixel widths for a table. They force that the browser
window is sized to a particular width to see the entire table, which
is not always desirable, let alone possible.
<LI>Tables are often used for page layout purposes. This is not
recommended, since it totally screws up the display for browsers which
do not support tables, and it also often gives awkward results on small
screens.
<LI>Earlier drafts of HTML 3.2 allowed the BORDER attribute to be
given without value (and then the value defaulted to 1). The final
version only permits BORDER=n.
<!-- Some browsers do not render TABLE BORDER=0 identical to TABLE
without a border attribute whatsoever. Bleh. -->
<LI>The HTML 3 draft did not include the values for the
BORDER attribute, so browsers which use this table model might draw
a border around your table when you use BORDER=0.
<LI>An empty table cell is typically drawn differently than a non-empty
cell. If you need a table cell with non content, but with the same
appareance as a non-empty cell, put "&amp;nbsp;" in the cell.

</UL>
<HR>
<CENTER>
<P>
<B><IMG SRC="../icon/wdglogo-small.gif" WIDTH=105 HEIGHT=40 ALT="Web Design Group" ALIGN=RIGHT></B><BR>
<A HREF="../index.html" TITLE="Index for Wilbur">Wilbur index</A>&nbsp;~
<A HREF="../overview.html" TITLE="Overview of HTML 3.2 tags">Tag overview</A>&nbsp;~
<A HREF="mailto:galactus@htmlhelp.com" TITLE="Wilbur reference feedback">Feedback</A>
<P>
<SMALL>
Copyright &copy; 1997 <A HREF="http://www.stack.nl/%7Egalactus/">Arnoud "Galactus" Engelfriet</A>.
</SMALL>
</CENTER>
</BODY>
</HTML>