[ Pobierz całość w formacie PDF ]
user agents may choose to reflow the table.
The table in this example contains six columns. The first one does not belong to
an explicit column group. The next three belong to the first explicit column group and
the last two belong to the second explicit column group. This table cannot be
formatted incrementally since it contains proportional column width specifications
and no value for the width attribute for the TABLE element.
Once the (visual) user agent has received the table s data: the available horizontal
space will be alloted by the user agent as follows: First the user agent will allot 30
pixels to columns one and two. Then, the minimal space required for the third
column will be reserved. The remaining horizontal space will be divided into six
equal portions (since 2* + 1* + 3* = 6 portions). Column four (2*) will receive two of
these portions, column five (1*) will receive one, and column six (3*) will receive
three.
...
...rows...
We have set the value of the align attribute in the third column group to "center".
All cells in every column in this group will inherit this value, but may override it. In
fact, the final COL does just that, by specifying that every cell in the column it
governs will be aligned along the ":" character.
123 24 Dec 1999 18:26
Tables in HTML documents
In the following table, the column width specifications allow the user agent to
format the table incrementally:
...
...rows...
The first ten columns will be 15 pixels wide each. The last two columns will each
receive half of the remaining 50 pixels. Note that the COL elements appear only so
that an id value may be specified for the last two columns.
Note. Although the width attribute on the TABLE element is not deprecated,
authors are encouraged to use style sheets to specify table widths.
11.2.5 Table rows: The TR element
%attrs; -- %coreattrs, %i18n, %events --
%cellhalign; -- horizontal alignment in cells --
%cellvalign; -- vertical alignment in cells --
>
Start tag: required, End tag: optional
Attributes defined elsewhere
id, class (document-wide identifiers [p.71] )
lang (language information [p.79] ), dir (text direction [p.82] )
title (element title [p.63] )
style (inline style information [p.186] )
onclick, ondblclick, onmousedown, onmouseup, onmouseover,
onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic
events [p.254] )
bgcolor (background color [p.195] )
align, char, charoff, valign (cell alignment [p.132] )
The TR elements acts as a container for a row of table cells. The end tag may be
omitted.
This sample table contains three rows, each begun by the TR element:
24 Dec 1999 18:26 124
Tables in HTML documents
of coffee consumed by each senator, the type
of coffee (decaf or regular), and whether
taken with sugar.">
Cups of coffee consumed by each senator
...A header row...
...First row of data...
...Second row of data...
...the rest of the table...
11.2.6 Table cells: The TH and TD elements
%attrs; -- %coreattrs, %i18n, %events --
abbr %Text; #IMPLIED -- abbreviation for header cell --
axis CDATA #IMPLIED -- comma-separated list of related headers--
headers IDREFS #IMPLIED -- list of id s for header cells --
scope %Scope; #IMPLIED -- scope covered by header cells --
rowspan NUMBER 1 -- number of rows spanned by cell --
colspan NUMBER 1 -- number of cols spanned by cell --
%cellhalign; -- horizontal alignment in cells --
%cellvalign; -- vertical alignment in cells --
>
Start tag: required, End tag: optional
Attribute definitions
headers = idrefs [p.50] [CS] [p.49]
This attribute specifies the list of header cells that provide header information for
the current data cell. The value of this attribute is a space-separated list of cell
names; those cells must be named by setting their id attribute. Authors
generally use the headers attribute to help non-visual user agents render
header information about data cells (e.g., header information is spoken prior to
the cell data), but the attribute may also be used in conjunction with style
sheets. See also the scope attribute.
scope = scope-name [CI] [p.49]
This attribute specifies the set of data cells for which the current header cell
provides header information. This attribute may be used in place of the
headers attribute, particularly for simple tables. When specified, this attribute
must have one of the following values:
row: The current cell provides header information for the rest of the row
that contains it (see also the section on table directionality [p.115] ).
[ Pobierz całość w formacie PDF ]