📄 rfc1942.txt
字号:
COLGROUP elements can be used with the following attributes:
ID, CLASS, LANG and DIR
See earlier description of common attributes.
SPAN
A positive integer value that specifies a default for how many
columns are in this group. This attribute should be ignored if
the COLGROUP element contains one or more COL elements. It
provides a convenient way of grouping columns without the need
to supply COL elements.
WIDTH
Specifies a default width for each of the grouped columns, see
standard units. In addition, the "*" suffix denotes relative
widths, e.g.
width=64 width in screen pixels
width=0.5* a relative width of 0.5
Relative widths act as constraints on the relative widths of
different columns. If a COLGROUP element specifies a relative
width of zero, all of the columns in the group should be set to
their minimum widths, unless they are associated with a COL
element with an overriding WIDTH attribute. When widths are
Raggett Experimental [Page 17]
RFC 1942 HTML Tables May 1996
given in absolute units, the user agent can use these to
constrain the width of the table. The "*" suffix is used to
simplify importing tables from the CALS representation.
ALIGN, CHAR, CHAROFF and VALIGN
Specify values for horizontal and vertical alignment within
table cells. See inheritance order of alignment properties.
The COL Element
<!ELEMENT col - O EMPTY>
<!ATTLIST col -- column groups and --
-- properties --
%attrs; -- id, lang, dir and class --
span NUMBER 1 -- number of columns spanned --
-- by group --
width CDATA #IMPLIED -- column width specification --
%cell.halign; -- horizontal alignment in --
-- cells --
%cell.valign; -- vertical alignment in cells --
>
This optional element is used to specify column based defaults for
table properties. It is an empty element, and as such has no
content, and shouldn't be given an end tag. Several COL elements may
be given in succession. COL attributes override those of the parent
COLGROUP element.
ID, CLASS, LANG and DIR
See earlier description of common attributes.
SPAN
A positive integer value that specifies how many columns this
element applies to, defaulting to one. In the absence of SPAN
attributes the first COL element applies to the first column,
the second COL element to the second column and so on. If the
second COL element had SPAN=2, it would apply to the second and
third column. The next COL element would then apply to the
fourth column and so on. SPAN=0 has a special significance and
implies that the COL element spans all columns from the current
column up to and including the last column. Note that a COL SPAN
does not define a group. It is merely a way to share attribute
definitions.
Raggett Experimental [Page 18]
RFC 1942 HTML Tables May 1996
WIDTH
Specifies the width of the columns, see standard units. If the
element spans several columns then the WIDTH attribute specifies
the width for each of the individual columns - not the width of
the span. In addition, the "*" suffix denotes relative widths,
e.g.
width=64 width in screen pixels
width=0.5* a relative width of 0.5
Relative widths act as constraints on the relative widths of
different columns. If a COL element specifies a relative width
of zero, the column should always be set to its minimum width.
When widths are given in absolute units, the user agent can use
these to constrain the width of the table. The "*" suffix is
used to simplify importing tables from the CALS representation.
ALIGN, CHAR, CHAROFF and VALIGN
Specify values for horizontal and vertical alignment within
table cells. See inheritance order of alignment properties.
Table Head, Foot and Body Elements
<!ELEMENT thead - O tr+>
<!ELEMENT tfoot - O tr+>
<!ELEMENT tbody O O tr+>
<!ATTLIST (thead|tbody|tfoot) -- table section --
%attrs; -- id, lang, dir and class --
%cell.halign; -- horizontal alignment in --
-- cells --
%cell.valign; -- vertical alignment in cells --
>
Tables may be divided up into head and body sections. The THEAD and
TFOOT elements are optional, but one or more TBODY elements are
always required. If the table only consists of a TBODY section, the
TBODY start and end tags may be omitted, as the parser can infer
them. If a THEAD element is present, the THEAD start tag is
required, but the end tag can be omitted, provided a TFOOT or TBODY
start tag follows. The same applies to TFOOT.
Note: This definition provides compatibility with tables created
for the older model, as well as allowing the end tags for THEAD,
TFOOT and TBODY to be omitted.
Raggett Experimental [Page 19]
RFC 1942 HTML Tables May 1996
The THEAD, TFOOT and TBODY elements provide a convenient means for
controlling rendering. If the table has a large number of rows in
the body, user agents may choose to use a scrolling region for the
table body sections. When rendering to a paged device, tables will
often have to be broken across page boundaries. The THEAD, TFOOT and
TBODY elements allow the user agent to repeat the table foot at the
bottom of the current page, and then the table head at the top of
the new page before continuing on with the table body.
TFOOT is placed before the TBODY in the markup sequence, so that
browsers can render the foot before receiving all of the table data.
This is useful when very long tables are rendered with scrolling
body sections, or for paged output, involving breaking the table
over many pages.
Each THEAD, TFOOT and TBODY element must contain one or more TR
elements.
ID, CLASS, LANG and DIR
See earlier description of common attributes.
ALIGN, CHAR, CHAROFF and VALIGN
Specify values for horizontal and vertical alignment within
table cells. See inheritance order of alignment properties.
Table Row (TR) elements
<!ELEMENT tr - O (th|td)+>
<!ATTLIST tr -- table row --
%attrs; -- id, lang, dir and class --
%cell.halign; -- horizontal alignment in --
-- cells --
%cell.valign; -- vertical alignment in cells --
>
The TR or table row element acts as a container for a row of table
cells. The end tag may be omitted.
ID, CLASS, LANG and DIR
See earlier description of common attributes.
ALIGN, CHAR, CHAROFF and VALIGN
Specify values for horizontal and vertical alignment within
table cells. See inheritance order of alignment properties.
Raggett Experimental [Page 20]
RFC 1942 HTML Tables May 1996
Table Cells: TH and TD
<!ELEMENT (th|td) - O %body.content>
<!ATTLIST (th|td) -- header or data cell --
%attrs; -- id, lang, dir and class --
axis CDATA #IMPLIED -- defaults to cell content --
axes CDATA #IMPLIED -- list of axis names --
nowrap (nowrap) #IMPLIED -- suppress word wrap --
rowspan NUMBER 1 -- number of rows spanned by --
-- cell --
colspan NUMBER 1 -- number of cols spanned by --
-- cell --
%cell.halign; -- horizontal alignment in --
-- cells --
%cell.valign; -- vertical alignment in cells --
>
TH elements are used to represent header cells, while TD elements
are used to represent data cells. This allows user agents to render
header and data cells distinctly, even in the absence of style
sheets.
Cells can span multiple rows and columns, and may be empty. Cells
spanning rows contribute to the column count on each of the spanned
rows, but only appear in the markup once (in the first row spanned).
The row count is determined by the number of TR elements. Any rows
implied by cells spanning rows beyond this should be ignored.
If the column count for the table is greater than the number of
cells for a given row (after including cells for spanned rows), the
missing cells are treated as occurring on the right hand side of the
table and rendered as empty cells. If the language context indicates
a right to left writing order, then the missing cells should be
placed on the left hand side.
It is possible to create tables with overlapping cells, for
instance:
<table border>
<tr><td rowspan=2>1<td>2<td>3
<tr><td rowspan=2>4
<tr><td colspan=2>5<td>6
</table>
Raggett Experimental [Page 21]
RFC 1942 HTML Tables May 1996
which might look something like:
/-----------\
| 1 | 2 | 3 |
| |-------|
| | 4 | |
|---|...|---|
| 5 : | 6 |
\-----------/
In this example, the cells labelled 4 and 5 overlap. In such cases,
the rendering is implementation dependent.
The AXIS and AXES attributes for cells provide a means for defining
concise labels for cells. When rendering to speech, these attributes
may be used to provide abbreviated names for the headers relevant to
each cell. Another application is when you want to be able to later
process table contents to enter them into a database. These
attributes are then used to give database field names. The table's
class attribute should be used to let the software recognize which
tables can be treated in this way.
ID, CLASS, LANG and DIR
See earlier description of common attributes.
AXIS
This defines an abbreviated name for a header cell, e.g. which
can be used when rendering to speech. It defaults to the cell's
content.
AXES
This is a comma separated list of axis names which together
identify the row and column headers that pertain to this cell.
It is used for example when rendering to speech to identify the
cell's position in the table. If missing the user agent can try
to follow up columns and left along rows (right for some
languages) to find the corresponding header cells.
NOWRAP, e.g. <TD NOWRAP>
The presence of this attribute disables automatic wrapping of
text lines for this cell. If used uncautiously, it may result in
excessively wide cells. This attribute is defined for backwards
compatibility with deployed user agents. Greater control is
possible with associated style sheet languages (for example for
control over overflow handling).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -