HTML 4.01 Test Suite - Assertions

Testable Assertions: Section 11 Tables


Valid HTML 4.01!


11 Tables

Assertion 11.1-1

Reference: Section 11.1
(may) User agents may exploit the head/body/foot division to support scrolling of body sections independently of the head and foot sections.
Tests: None

Assertion 11.1-2

Reference: Section 11.1
(may) When long tables are printed, the head and foot information may be repeated on each page that contains table data.
Tests: None

Assertion 11.1-3

Reference: Section 11.1
(author)(should) Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media.
Tests: None

Assertion 11.1-4

Reference: Section 11.1
(author)(should) Authors should use style sheets to control layout rather than tables.
Tests: None

Assertion 11.2.1-1

Reference: Section 11.2.1
(author)(must) TABLE: The start tag and end tag are required.
Tests: None

Assertion 11.2.1-2

Reference: Section 11.2.1
(must) TABLE summary = text [CS] This attribute provides a summary of the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.
Tests: None

Assertion 11.2.1-3

Reference: Section 11.2.1
(must)(deprecated) TABLE align = left|center|right [CI] This attribute specifies the position of the table with respect to the document. Permitted values: left: The table is to the left of the document. center: The table is to the center of the document. right: The table is to the right of the document.
Tests: None

Assertion 11.2.1-4

Reference: Section 11.2.1
(must) TABLE width = length [CN] This attribute specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space. In the absence of any width specification, table width is determined by the user agent.
Tests: 11_2_1-BF-01.html

Assertion 11.2.1-5

Reference: Section 11.2.1
(author)(must) In order for a user agent to format a table in one pass, authors must tell it the number of columns in the table.
Tests: None

Assertion 11.2.1-6

Reference: Section 11.2.1
(author)(must) In order for a user agent to format a table in one pass, authors must tell it the widths of the columns.
Tests: None

Assertion 11.2.1-7

Reference: Section 11.2.1
(must) The directionality of a table is either the inherited directionality (the default is left-to-right) or that specified by the dir attribute (defined in chapter 8) for the TABLE element.
Tests: None

Assertion 11.2.1-8

Reference: Section 11.2.1
(must) When a user agent allots extra cells to a row, extra row cells are added to the right of the table for left-to-right tables and to the left side for right-to-left tables.
Tests: None

Assertion 11.2.1-9

Reference: Section 11.2.1
(must) TABLE is the only element on which the dir attribute reverses the visual order of the columns. A single table row (TR) or a group of columns (COLGROUP) cannot be independently reversed.
Tests: None

Assertion 11.2.1-10

Reference: Section 11.2.1
(must) When set for the TABLE element, the dir attribute also affects the direction of text within table cells (since the dir attribute is inherited by block-level elements).
Tests: None

Assertion 11.2.1-11

Reference: Section 11.2.1
(must) The direction of text in individual cells can be changed by setting the dir attribute in an element that defines the cell.
Tests: None

Assertion 11.2.2-1

Reference: Section 11.2.2
(author)(must) CAPTION: The start tag and end tag are required.
Tests: None

Assertion 11.2.2-2

Reference: Section 11.2.2
(must)(deprecated) CAPTION align = top|bottom|left|right [CI] For visual user agents, this attribute specifies the position of the caption with respect to the table. Possible values: top: The caption is at the top of the table. This is the default value. bottom: The caption is at the bottom of the table. left: The caption is at the left of the table. right: The caption is at the right of the table.
Tests: None

Assertion 11.2.2-3

Reference: Section 11.2.2
(author)(should) When present, the CAPTION element's text should describe the nature of the table.
Tests: None

Assertion 11.2.2-4

Reference: Section 11.2.2
(author)(must) The CAPTION element is only permitted immediately after the TABLE start tag.
Tests: None

Assertion 11.2.2-5

Reference: Section 11.2.2
(author)(must) A TABLE element may only contain one CAPTION element.
Tests: None

Assertion 11.2.2-6

Reference: Section 11.2.2
(author)(should) Authors should take care to provide additional (i.e. other than in CAPTION) information summarizing the purpose and structure of the table using the summary attribute of the TABLE element.
Tests: None

Assertion 11.2.2-7

Reference: Section 11.2.2
(should) Visual user agents should avoid clipping any part of the table including the caption, unless a means is provided to access all parts.
Tests: None

Assertion 11.2.2-8

Reference: Section 11.2.2
(should) It is recommended that the caption text be wrapped to the same width as the table.
Tests: None

Assertion 11.2.3-1

Reference: Section 11.2.3
(author)(may) Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively.
Tests: None

Assertion 11.2.3-2

Reference: Section 11.2.3
(may) When long tables are printed, the table head and foot information my be repeated on each page that contains table data.
Tests: None

Assertion 11.2.3-3

Reference: Section 11.2.3
(author)(should) The table head and table foot should contain information about the table's columns.
Tests: None

Assertion 11.2.3-4

Reference: Section 11.2.3
(author)(should) The table body should contain rows of table data.
Tests: None

Assertion 11.2.3-5

Reference: Section 11.2.3
(author)(must) When present, each THEAD, TFOOT and TBODY contains a row group. Each row group must contain at least one row, defined by the TR element.
Tests: None

Assertion 11.2.3-6

Reference: Section 11.2.3
(author)(must) TFOOT must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the rows of data.
Tests: None

Assertion 11.2.3-7

Reference: Section 11.2.3
(author)(must) The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections. The TBODY end tag may always be safely omitted.
Tests: None

Assertion 11.2.3-8

Reference: Section 11.2.3
(author)(must) The start tags for THEAD and TFOOT are required when the table head and foot sections are present respectively, but the corresponding end tags may always be safely omitted.
Tests: None

Assertion 11.2.3-9

Reference: Section 11.2.3
(author)(must) The THEAD, TFOOT and TBODY sections must contain the same number of columns.
Tests: None

Assertion 11.2.4-1

Reference: Section 11.2.4
(may) A table may either contain a single implicit column group (no COLGROUP element delimits the columns) or any number of explicit column groups (each delimited by an instance of the COLGROUP element).
Tests: None

Assertion 11.2.4-2

Reference: Section 11.2.4
(author)(must) COLGROUP: The start tag is required and the end tag is optional.
Tests: None

Assertion 11.2.4-3

Reference: Section 11.2.4
(must) COLGROUP span = number [CN] This attribute, which must be an integer > 0, specifies the number of columns in a column group. Values mean the following: In the absence of a span attribute, each COLGROUP defines a column group containing one column. If the span attribute is set to N > 0, the current COLGROUP element defines a column group containing N columns.
Tests: None

Assertion 11.2.4-4

Reference: Section 11.2.4
(must) User agents must ignore the span attribute of the COLGROUP element if the COLGROUP element contains one or more COL elements.
Tests: None

Assertion 11.2.4-5

Reference: Section 11.2.4
(must) width = multi-length [CN] This attribute specifies a default width for each column in the current column group. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form "0*" (zero asterisk) which means that the width of the each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying "0*" will prevent visual user agents from rendering a table incrementally.
Tests: None

Assertion 11.2.4-6

Reference: Section 11.2.4
(must) The width attribute of the COLGROUP elements is overridden for any column in the column group whose width is specified via a COL element.
Tests: None

Assertion 11.2.4-7

Reference: Section 11.2.4
(must) The COLGROUP element creates an explicit column group. The number of columns in the column group may be specified in two, mutually exclusive ways: 1. The element's span attribute (default value 1) specifies the number of columns in the group. 2. Each COL element in the COLGROUP represents one or more columns in the group.
Tests: None

Assertion 11.2.4-8

Reference: Section 11.2.4
(author)(must) When it is necessary to single out a column (e.g., for style information, to specify width information, etc.) within a group, authors must identify that column with a COL element.
Tests: None

Assertion 11.2.4-9

Reference: Section 11.2.4
(author)(must) COL: The start tag is required and the end tag is forbidden.
Tests: None

Assertion 11.2.4-10

Reference: Section 11.2.4
(must) COL span = number [CN] This attribute, whose value must be an integer > 0, specifies the number of columns "spanned" by the COL element; the COL element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., the COL element refers to a single column). If the span attribute is set to N > 1, the current COL element shares its attributes with the next N-1 columns.
Tests: None

Assertion 11.2.4-11

Reference: Section 11.2.4
(must) COL width = multi-length [CN] This attribute specifies a default width for each column spanned by the current COL element. It has the same meaning as the width attribute for the COLGROUP element and overrides it.
Tests: None

Assertion 11.2.4-12

Reference: Section 11.2.4
(must) The COL element allows authors to group together attribute specifications for table columns. The COL does not group columns together structurally -- that is the role of the COLGROUP element. COL elements are empty and serve only as a support for attributes. They may appear inside or outside an explicit column group (i.e., COLGROUP element).
Tests: None

Assertion 11.2.4-13

Reference: Section 11.2.4
(must) The width attribute for COL refers to the width of each column in the element's span.
Tests: None

Assertion 11.2.4-14

Reference: Section 11.2.4
(must) There are two ways to determine the number of columns in a table (in order of precedence): 1. If the TABLE element contains any COLGROUP or COL elements, user agents should calculate the number of columns by summing the following: For each COL element, take the value of its span attribute (default value 1). For each COLGROUP element containing at least one COL element, ignore the span attribute for the COLGROUP element. For each COL element, perform the calculation of step 1. For each empty COLGROUP element, take the value of its span attribute (default value 1). 2. Otherwise, if the TABLE element contains no COLGROUP or COL elements, user agents should base the number of columns on what is required by the rows. The number of columns is equal to the number of columns required by the row with the most columns, including cells that span multiple columns. For any row that has fewer than this number of columns, the end of that row should be padded with empty cells. The "end" of a row depends on the table directionality.
Tests: None

Assertion 11.2.4-15

Reference: Section 11.2.4
(author)(must) It is an error if a table contains COLGROUP or COL elements and the two calculations do not result in the same number of columns.
Tests: None

Assertion 11.2.4-16

Reference: Section 11.2.4
(author)(may) Authors may specify column widths in three ways: 1. A fixed width specification is given in pixels (e.g., width="30"). A fixed-width specification enables incremental rendering. 2. A percentage specification (e.g., width="20%") is based on the percentage of the horizontal space available to the table (between the current left and right margins, including floats). Note that this space does not depend on the table itself, and thus percentage specifications enable incremental rendering. 3. Proportional specifications (e.g., width="3*") refer to portions of the horizontal space required by a table. If the table width is given a fixed value via the width attribute of the TABLE element, user agents may render the table incrementally even with proportional columns.
Tests: None

Assertion 11.2.4-17

Reference: Section 11.2.4
(author)(should) Although the width attribute on the TABLE element is not deprecated, authors are encouraged to use style sheets to specify table widths.
Tests: None

Assertion 11.2.5-1

Reference: Section 11.2.5
(author)(must) TR: The start tag is required and the end tag is optional.
Tests: None

Assertion 11.2.5-2

Reference: Section 11.2.5
(must) The TR elements [sic] acts as a container for a row of table cells.
Tests: None

Assertion 11.2.6-1

Reference: Section 11.2.6
(author)(must) TH and TD: The start tag is required and the end tag is optional.
Tests: None

Assertion 11.2.6-2

Reference: Section 11.2.6
(must) TH and TD: headers = idrefs [CS] 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.
Tests: None

Assertion 11.2.6-3

Reference: Section 11.2.6
(must) TH and TD: scope = scope-name [CI] 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). col: The current cell provides header information for the rest of the column that contains it. rowgroup: The header cell provides header information for the rest of the row group that contains it. colgroup: The header cell provides header information for the rest of the column group that contains it.
Tests: None

Assertion 11.2.6-4

Reference: Section 11.2.6
(must) TH and TD: abbr = text [CS] This attribute should be used to provide an abbreviated form of the cell's content, and may be rendered by user agents when appropriate in place of the cell's content. Abbreviated names should be short since user agents may render them repeatedly. For instance, speech synthesizers may render the abbreviated headers relating to a particular cell before rendering that cell's content.
Tests: None

Assertion 11.2.6-5

Reference: Section 11.2.6
(must) TH and TD: axis = cdata [CI] This attribute may be used to place a cell into conceptual categories that can be considered to form axes in an n-dimensional space. User agents may give users access to these categories (e.g., the user may query the user agent for all cells that belong to certain categories, the user agent may present a table in the form of a table of contents, etc.). Please consult the section on categorizing cells for more information. The value of this attribute is a comma-separated list of category names.
Tests: None

Assertion 11.2.6-6

Reference: Section 11.2.6
(must) TH and TD: rowspan = number [CN] This attribute specifies the number of rows spanned by the current cell. The default value of this attribute is one ("1"). The value zero ("0") means that the cell spans all rows from the current row to the last row of the table section (THEAD, TBODY, or TFOOT) in which the cell is defined.
Tests: 11_2_6-BF-01.html

Assertion 11.2.6-7

Reference: Section 11.2.6
(must) TH and TD: colspan = number [CN] This attribute specifies the number of columns spanned by the current cell. The default value of this attribute is one ("1"). The value zero ("0") means that the cell spans all columns from the current column to the last column of the column group (COLGROUP) in which the cell is defined.
Tests: 11_2_6-BF-02.html

Assertion 11.2.6-8

Reference: Section 11.2.6
(must)(deprecated) TH and TD: nowrap [CI] When present, this boolean attribute tells visual user agents to disable automatic text wrapping for this cell. Style sheets should be used instead of this attribute to achieve wrapping effects. Note. if used carelessly, this attribute may result in excessively wide cells.
Tests: None

Assertion 11.2.6-9

Reference: Section 11.2.6
(must)(deprecated) TH and TD: width = length [CN] This attribute supplies user agents with a recommended cell width.
Tests: None

Assertion 11.2.6-10

Reference: Section 11.2.6
(must)(deprecated) TH and TD: height = length [CN] This attribute supplies user agents with a recommended cell height.
Tests: None

Assertion 11.2.6-11

Reference: Section 11.2.6
(author)(must) The TH element defines a cell that contains header information.
Tests: None

Assertion 11.2.6-12

Reference: Section 11.2.6
(must) User agents have two pieces of header information available: the contents of the TH element and the value of the abbr attribute. User agents must render either the contents of the cell or the value of the abbr attribute.
Tests: None

Assertion 11.2.6-13

Reference: Section 11.2.6
(author)(must) The TD element defines a cell that contains data.
Tests: None

Assertion 11.2.6-14

Reference: Section 11.2.6
(must) Cells may be empty (i.e. contain no data.)
Tests: None

Assertion 11.2.6-15

Reference: Section 11.2.6
(author)(must) Defining overlapping cells is an error.
Tests: None

Assertion 11.2.6-16

Reference: Section 11.2.6
(may) User agents may vary in how they handle overlapping cells.
Tests: None

Assertion 11.3.1-1

Reference: Section 11.3.1
(must) TABLE frame = void|above|below|hsides|lhs|rhs|vsides|box|border [CI] This attribute specifies which sides of the frame surrounding a table will be visible. Possible values: void: No sides. This is the default value. above: The top side only. below: The bottom side only. hsides: The top and bottom sides only. vsides: The right and left sides only. lhs: The left-hand side only. rhs: The right-hand side only. box: All four sides. border: All four sides.
Tests: None

Assertion 11.3.1-2

Reference: Section 11.3.1
(must) TABLE rules = none|groups|rows|cols|all [CI] This attribute specifies which rules will appear between cells within a table. The rendering of rules is user agent dependent. Possible values: none: No rules. This is the default value. groups: Rules will appear between row groups (see THEAD, TFOOT, and TBODY) and column groups (see COLGROUP and COL) only. rows: Rules will appear between rows only. cols: Rules will appear between columns only. all: Rules will appear between all rows and columns.
Tests: None

Assertion 11.3.1-3

Reference: Section 11.3.1
(must) TABLE border = pixels [CN] This attributes specifies the width (in pixels only) of the frame around a table (see the Note below for more information about this attribute).
Tests: 11_3_1-BF-02.html

Assertion 11.3.1-4

Reference: Section 11.3.1
(should) The following settings should be observed by user agents for backwards compatibility. 1. Setting border="0" implies frame="void" and, unless otherwise specified, rules="none". 2. Other values of border imply frame="border" and, unless otherwise specified, rules="all". 3. The value "border" in the start tag of the TABLE element should be interpreted as the value of the frame attribute. It implies rules="all" and some default (non-zero) value for the border attribute.
Tests: None

Assertion 11.3.2-1

Reference: Section 11.3.2
(must) align = left|center|right|justify|char [CI] This attribute specifies the alignment of data and the justification of text in a cell. Possible values: left: Left-flush data/Left-justify text. This is the default value for table data. center: Center data/Center-justify text. This is the default value for table headers. right: Right-flush data/Right-justify text. justify: Double-justify text. char: Align text around a specific character. If a user agent doesn't support character alignment, behavior in the presence of this value is unspecified.
Tests: None

Assertion 11.3.2-2

Reference: Section 11.3.2
(must) valign = top|middle|bottom|baseline [CI] This attribute specifies the vertical position of data within a cell. Possible values: top: Cell data is flush with the top of the cell. middle: Cell data is centered vertically within the cell. This is the default value. bottom: Cell data is flush with the bottom of the cell. baseline: All cells in the same row as a cell whose valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.
Tests: None

Assertion 11.3.2-3

Reference: Section 11.3.2
(must) char = character [CN] This attribute specifies a single character within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the lang attribute (e.g., the period (".") in English and the comma (",") in French). User agents are not required to support this attribute. [NOTE: I assume they mean the lang attribute is not required.]
Tests: None

Assertion 11.3.2-4

Reference: Section 11.3.2
(must) charoff = length [CN] When present, this attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. When charoff is used to set the offset of an alignment character, the direction of offset is determined by the current text direction (set by the dir attribute). In left-to-right texts (the default), offset is from the left margin. In right-to-left texts, offset is from the right margin. User agents are not required to support this attribute. [NOTE: I assume they mean the dir attribute is not required.]
Tests: None

Assertion 11.3.2-5

Reference: Section 11.3.2
(author)(should) When the contents of a cell contain more than one instance of the alignment character specified by char and the contents wrap, user agent behavior is undefined. Authors should therefore be attentive in their use of char.
Tests: None

Assertion 11.3.2-6

Reference: Section 11.3.2
(must) The order of precedence (from highest to lowest) for the attributes align, char, and charoff is the following: 1. An alignment attribute set on an element within a cell's data (e.g., P). 2. An alignment attribute set on a cell (TH and TD). 3. An alignment attribute set on a column grouping element (COL and COLGROUP). When a cell is part of a multi-column span, the alignment property is inherited from the cell definition at the beginning of the span. 4. An alignment attribute set on a row or row grouping element (TR, THEAD, TFOOT, and TBODY). When a cell is part of a multi-row span, the alignment property is inherited from the cell definition at the beginning of the span. 5. An alignment attribute set on the table (TABLE). 6. The default alignment value.
Tests: None

Assertion 11.3.2-7

Reference: Section 11.3.2
(must) The order of precedence (from highest to lowest) for the attribute valign (as well as the other inherited attributes lang, dir, and style) is the following:1. An attribute set on an element within a cell's data (e.g., P). 2. An attribute set on a cell (TH and TD). 3. An attribute set on a row or row grouping element (TR, THEAD, TFOOT, and TBODY). When a cell is part of a multi-row span, the attribute value is inherited from the cell definition at the beginning of the span. 4. An attribute set on a column grouping element (COL and COLGROUP). When a cell is part of a multi-column span, the attribute value is inherited from the cell definition at the beginning of the span. 5. An attribute set on the table (TABLE). 6. The default attribute value.
Tests: None

Assertion 11.3.2-8

Reference: Section 11.3.2
(must) When rendering cells, horizontal alignment is determined by columns in preference to rows, while for vertical alignment, rows are given preference over columns.
Tests: None

Assertion 11.3.2-9

Reference: Section 11.3.2
(should) The default alignment for cells depends on the user agent. However, user agents should substitute the default attribute for the current directionality (i.e., not just "left" in all cases).
Tests: None

Assertion 11.3.2-10

Reference: Section 11.3.2
(should) User agents that do not support the "justify" value of the align attribute should use the value of the inherited directionality in its place.
Tests: None

Assertion 11.3.3-1

Reference: Section 11.3.3
(must) cellspacing = length [CN] This attribute specifies how much space the user agent should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.
Tests: None

Assertion 11.3.3-2

Reference: Section 11.3.3
(must) cellpadding = length [CN] This attribute specifies the amount of space between the border of the cell and its contents. If the value of this attribute is a pixel length, all four margins should be this distance from the contents. If the value of the attribute is a percentage length, the top and bottom margins should be equally separated from the content based on a percentage of the available vertical space, and the left and right margins should be equally separated from the content based on a percentage of the available horizontal space.
Tests: None

Assertion 11.3.3-3

Reference: Section 11.3.3
(may) If a table or given column has a fixed width, cellspacing and cellpadding may demand more space than assigned. User agents may give these attributes precedence over the width attribute when a conflict occurs, but are not required to.
Tests: None