3.12 Standard Markups -- Table


main page
top:Skribe User Manual
index:Index
markups:Standard Markups


Standard Markups
Markup index
3.1Document
3.2Sectioning
3.3Table of contents
3.4Ornaments
3.5Line breaks
3.6Font
3.7Justification
3.8Enumeration
3.9Frame and color
3.10Figure
3.11Image
3.12Table
3.13Footnote
3.14Characters, Strings and Symbols


Chapters
1Getting Started
2Syntax & Values
3Standard Markups
4References and Hyperlinks
5Indexes
6Bibliography
7Computer programs
8Standard Library
9Engines
10Editing Skribe Programs
11Skribe compiler
12Compiling Texi documents
13List of examples
14Table of contents

Tables are defined by the means of the table function.

prototype
(table [:ident] [:class] [:border] [:width] [:cellpadding 2] [:cellspacing -1] row...)
optionenginesdescription
:identhtml latex The node identifier.
:classhtml latex The node class.
:borderhtml latex If the :border value is an integer, that number specifies the border width of the table.
:widthhtml latex The width of the table.
:cellpaddinghtml latex A number of pixels around each cell.
:cellspacinghtml latex An optional number of pixels used to separate each cell of the table. A negative uses the target default.
argumentdescription
row...The rows of the table. Each row must be constructed by the trtr function.

3.12.1 Table row

Table rows are defined by the tr function.

prototype
(tr [:ident] [:class] [:bg] cell...)
optionenginesdescription
:identhtml latex The node identifier.
:classhtml latex The node class.
:bghtml latex The background color of the row.
argumentdescription
cell...The row cells.

3.12.2 Table cell

Two functions define table cells: th for header cells and td for plain cells.

prototype
(th [:ident] [:class] [:width] [:align 'center] [:valign] [:rowspan 1] [:colspan 1] [:bg] node)
(td [:ident] [:class] [:width] [:align 'center] [:valign] [:rowspan 1] [:colspan 1] [:bg] node)
optionenginesdescription
:identhtml latex The node identifier.
:classhtml latex The node class.
:bgThe background color of the cell.
:widthThe width of the table.
:alignThe horizontal alignment of the table cell (left, right, or center. Some engines, such as the HTML engine, also supports a character for the alignment.)
:valignThe vertical alignment of the cell. The value can be top, center, bottom.
:rowspanThe number of rows that the cell expands to.
:colspanThe number of columns that the cell expands to.
argumentdescription
nodeThe value of the cell.

3.12.3 Example

Example:
(center
 (table :border 1 :width 50.
        (tr :bg "#cccccc" (th :align 'center :colspan 3 "A table"))
        (tr (th "Col 1") (th "Col 2") (th "Col 3"))
        (tr (td :align 'center "10") (td "-20") (td "30"))
        (tr (td :align 'right :rowspan 2 :valign 'center "12") (td "21"))
        (tr (td :align 'center :colspan 2 "1234"))
        (tr (td :align 'center :colspan 2 "1234") (td :align 'right "5"))
        (tr (td :align 'center :colspan 1 "1") (td :colspan 2 "2345"))))
Ex. 16: A table
Produces:
A table
Col 1Col 2Col 3
10-2030
1221
1234
12345
12345

This Html page has been produced by Skribe.
Last update Wed Oct 12 20:03:08 2005.