<colspec> is an empty formatting element used to designate the position and size of each column in a <table>. It may designate specify a unique name for the column, its unique number within the table, its width, rules, and the horizontal alignment of its text. It is found within the <tgroup> element inside <table> and the number of columns in the table must be set by an attribute in <tgroup>. However, this attribute’s values override any implied higher-level values.
Attributes
For a full list of tabular elements see the LoC tag library.
- ALIGN – not required. Designates the horizontal position of text within a column. Values may be: left, right, center, justify (flush left and right), and char (alignment on a single character such as a decimal, as positioned by CHAROFF).
- CHAR – not required. Names the character (such as decimal, asterisk, or em-dash) on which the text will align.
- CHAROFF – not required. If CHAR is used, this is the percentage of the current column width to the left edge of the alignment character. Number.
- COLNAME – not required. Letters and/or numbers (no spaces) used to give the column a unique name.
- COLNUM – not required. The number of the column, as counting from the left.
- COLSEP – not required. Use “1” to display a vertical rule to the right of the column and “0” for no vertical rule.
- COLWIDTH – not required. A fixed width for the column. Units may be “pt,” “cm,” “in,” and an * for proportional measures, such as “5*”.
- ROWSEP – not required. Use “1” to display a horizontal rule below the row and “0” for no horizontal rule.
Subelements
<colspec> is an empty element and only contains data through its attributes.
Examples
The following example is taken from the Library of Congress tag library:
<table frame="none"> <tgroup cols="3"> <colspec colnum="1" colname="1" align="left" colwidth="50pt"/> <colspec colnum="2" colname="2" align="left" colwidth="50pt"/> <colspec colnum="3" colname="3" align="left" colwidth="50pt"/> <thead> <row> <entry colname="1">Major Family Members</entry> <entry colname="2">Spouses</entry> <entry colname="3">Children</entry> </row> </thead> <tbody> <row> <entry colname="1">John Albemarle (1760-1806)</entry> <entry colname="2">Mary Frances Delaney (1769-1835)</entry> <entry colname="3">John Delaney Albemarle (1787-1848)</entry> </row> . . . </tbody> </tgroup> </table> |