Connected: An Internet Encyclopedia
4.2. Horizontal and Vertical Alignment Attributes

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1942
Up: 4. A walk through the Table DTD
Prev: 4.1. Common Attributes
Next: 4.3. Inheritance Order

4.2. Horizontal and Vertical Alignment Attributes

4.2. Horizontal and Vertical Alignment Attributes

The alignment of cell contents can be specified on a cell by cell basis, or inherited from enclosing elements, such as the row, column or the table element itself.

This specifies the horizontal alignment of cell contents.

   <!-- horizontal alignment attributes for cell contents -->
   <!ENTITY % cell.halign
           "align  (left|center|right|justify|char) #IMPLIED
            char    CDATA   #IMPLIED -- alignment char, e.g. char=':' --
            charoff CDATA   #IMPLIED -- offset for alignment char --"

The attribute value should be one of LEFT, CENTER, RIGHT, JUSTIFY and CHAR. User agents may treat JUSTIFY as left alignment if they lack support for text justification. ALIGN=CHAR is used for aligning cell contents on a particular character.

For cells spanning multiple rows or columns, where the alignment property is inherited from the row or column, the initial row and column for the cell determines the appropriate alignment property to use.

Note that an alignment attribute on elements within the cell, e.g. on a P element, overrides the normal alignment value for the cell.

This is used to specify an alignment character for use with align=char, e.g. char=":". The default character is the decimal point for the current language, as set by the LANG attribute. The CHAR attribute value is case sensitive.

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. The resolved direction of the cell, as determined by the inheritance of the DIR attribute, is used to set whether the offset is from the left or right margin of the cell. For Latin scripts, the offset will be from the left margin, while for Arabic scripts, it will be from the right margin. In addition to standard units, the "%" sign may be used to indicate that the value specifies the alignment position as a percentage offset of the current cell, e.g. CHAROFF="30%" indicates the alignment character should be positioned 30% through the cell.

When using the two pass layout algorithm, the default alignment position in the absence of an explicit or inherited CHAROFF attribute can be determined by choosing the position that would center lines for which the width before and after the alignment character are at the maximum values for any of the lines in the column for which ALIGN=CHAR. For incremental table layout the suggested default is CHAROFF="50%". If several cells in different rows for the same column use character alignment, then by default, all such cells should line up, regardless of which character is used for alignment. Rules for handling objects too large for column apply when the explicit or implied alignment results in a situation where the data exceeds the assigned width of the column.

Defines whether the cell contents are aligned with the top, middle or bottom of the cell.

       <!-- vertical alignment attributes for cell contents -->
       <!ENTITY % cell.valign
               "valign  (top|middle|bottom|baseline)  #IMPLIED"

If present, the value of the attribute should be one of: TOP, MIDDLE, BOTTOM or BASELINE. All cells in the same row with valign=baseline should be vertically positioned so that the first text line in each such cell occur on a common baseline. This constraint does not apply to subsequent text lines in these cells.

Next: 4.3. Inheritance Order

Connected: An Internet Encyclopedia
4.2. Horizontal and Vertical Alignment Attributes