home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


SUMMARY=“string” (optional; not currently supported) This attribute contains a text description of the table’s purpose and structure and is designed to be used by software that renders the table in a nonvisual way, such as a text-to-speech synthesizer, or a Braille output device. This is not supported by either Netscape Navigator or Internet Explorer.

WIDTH=“number,” or “real%” (optional) Prescribes the desired width of the table, either as an absolute width (number) in pixels or as a percentage width (real%) in the range 0% to 100%. Percentage widths are calculated relative to the available width: For example, if a table lies within a cell of another table, the width is calculated relative to the width of this enclosing cell. Note, however, that a browser is free to ignore these width specifications, should the table content not fit in the designated space. Note also that fixing a table to a particular pixel width may introduce formatting difficulties, should the table not fit easily within the specified size.

CAPTION Element: Table Caption

Usage: <CAPTION> ... </CAPTION>
Can Contain: characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, IFRAME, IMG, INPUT, LABEL, MAP, OBJECT, SCRIPT, SELECT, TEXTAREA
Can Be Inside: TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
ALIGN

CAPTION specifies an optional table caption or title. A TABLE can have at most one CAPTION. A CAPTION can contain text, character highlighting, IMG, and hypertext anchors elements, but not block content. CAPTION supports the standard “generic” and “event-handler” attributes described earlier in this chapter. Note that the event handlers are only partially supported by Internet Explorer 4 and are not supported by Netscape Navigator 4.

CAPTION can also take the optional attribute ALIGN to specify how the caption is aligned relative to the TABLE. The allowed values and their meanings are:
ALIGN=“top,” “bottom,” “left,” “right,” (optional; “left” and “right” supported only by Internet Explorer) ALIGN specifies the desired location for the caption relative to the table. ALIGN=“top” (the default) places the caption above the table, while ALIGN=“bottom” places the caption below it. Internet Explorer 3 supports the additional values “left” and “right,” which place the caption on top of the table, but left- or right-adjust the title relative to the left or right edge of the table. Note that Netscape Navigator 4 does not support the values “left” or “right.”
Figures 6.31 and 6.32 illustrate an example table caption.

COL Element: Specify Properties of a Column (Internet Explorer Only)

Usage: <COL>
Can Contain: empty
Can Be Inside: COLGROUP, TABLE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers, ALIGN, BGCOLOR, CHAR, CHAROFF, REPEAT, SPAN, VALIGN, WIDTH

COL is an optional element and is used to specify default properties for a column or a group of columns. A table will generally have multiple COL elements to specify properties of the different columns. For example,

<COL ALIGN="left">
<COL ALIGN="right">
<COL ALIGN="center">

indicates that the first column content should be left-aligned, the second column content right-aligned, and the third column content center-aligned. The number of columns affected by a COL is set by the SPAN attribute. The default value for SPAN is 1. The SPAN attribute is only supported by Internet Explorer 4, which currently implements only partial support, as discussed in the following.

ALIGN=“left,” “center,” “right,” “justify,” “char”Specifies how the cell contents should be horizontally aligned within the cell. The values “left,” “center,” “right,” and “justify” have the obvious meanings. Internet Explorer also supports the value “middle” as a synonym for “center”—for consistency with the standard, use “center.” The value “char” indicates that the contents should be aligned on a particular alignment character, such as a decimal or comma (the alignment character is defined by the CHAR attribute). ALIGN is only supported by Internet Explorer 3 and 4, neither of which support the values “justify” or “char.”
BGCOLOR=“#rrggbb,” “color” (optional) Specifies the background color for the column of cells: This sets the color only for the cells and does not affect the boundary between cells. Note that this is an Internet Explorer-specific extension to HTML. For forward compatibility, you should use cascading style sheets to set table cell background colors.
CHAR=“c” (optional; not currently supported) Specifies the character upon with the cell contents should be column-aligned, given that ALIGN=“char” is specified. The value can be any valid character, character reference or entity reference. The default value is the decimal point character as determined from the LANG attribute (e.g., a period in English and a comma in French). If the text to be aligned does not contain the alignment character, then the text is positioned such that the leading portion of the text is aligned with the vertical alignment position. This attribute is not currently supported.
CHAROFF=“number,” “real%” (optional; not currently supported) Specifies the offset of the line of vertical alignment relative to the edge of the cell: The edge (left or right) is determined from the directionality of the text flow, as defined by DIR or LANG. The value is given either in pixels, or as a percentage of the cell width. This attribute is not supported on current commercial browsers.
REPEAT=“number” (optional; not currently supported) Repeat is a synonym for SPAN and sets the number of columns affected by a COL element. This attribute will replace SPAN, discussed below. For backwards (and forwards) compatibility, COL elements that use SPAN should also use REPEAT, for example
<COL ALIGN="left" SPAN="2" REPEAT="2">
SPAN=“number” (optional) The number of columns affected by a COL is set by the SPAN attribute. Thus, SPAN=“3” means that the properties specified by the COL element apply to three adjacent columns. For example,
<COL ALIGN="left">
<COL SPAN=3 ALIGN="center">
<COL ALIGN="right">
indicates that the second, third, and fourth columns should be center-aligned and that the fifth column content should be right-aligned. The value SPAN=“0” is special, and should indicate that the properties apply to all columns from the current column up to the last column in the table. This special meaning for SPAN=“0” is not, however, supported by Internet Explorer 3 or 4.
VALIGN=“top,” “middle,” “bottom,” “baseline” (optional) Specifies how the cell contents should be vertically aligned within the cell. The values “top,” “middle,” and “bottom” have the obvious meanings. The value “baseline” aligns the baseline of the content (text baseline or image bottom) with the baseline of adjacent cells in the row. At present, the only supported values are “top,” “middle,” and “bottom.” Current browsers also support the value “middle” as a synonym for “center.” For consistency with the standard, use “center.”
WIDTH=“number,” “real%,” “real*”(optional) Specifies the desired width of a column, in three ways: as a length in pixels; as a percentage value (relative to the full width of the table) or as a “star” value (in which case the width is determined relative to the widths of the other table cells). This value can be ignored if the resulting table does not fit within the browser window. Current browsers do not support values ending with an asterisk (*), but do support percentage and pixel values.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.