|
Tables are defined by the means of the table function.
prototype |
(table [:ident] [:class] [:border] [:width] [:cellpadding 2 ] [:cellspacing -1 ] row... ) |
:ident | html latex | The node identifier. |
:class | html latex | The node class. |
:border | html latex | If the :border value is an integer, that
number specifies the border width of the table. |
:width | html latex | The width of the table. |
:cellpadding | html latex | A number of pixels around each cell. |
:cellspacing | html latex | An optional number of pixels used to separate each
cell of the table. A negative uses the target
default. |
row... | The rows of the table. Each row must be
constructed by the
trtr function. |
Table rows are defined by the tr function.
prototype |
(tr [:ident] [:class] [:bg] cell... ) |
:ident | html latex | The node identifier. |
:class | html latex | The node class. |
:bg | html latex | The background color of the row. |
cell... | The row cells. |
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 ) |
:ident | html latex | The node identifier. |
:class | html latex | The node class. |
:bg | | The background color of the cell. |
:width | | The width of the table. |
:align | | The horizontal alignment of the table cell
(left, right, or center. Some
engines, such as the HTML engine, also supports a
character for the alignment.) |
:valign | | The vertical alignment of the cell. The value can
be top, center, bottom. |
:rowspan | | The number of rows that the cell expands to. |
:colspan | | The number of columns that the cell expands to. |
node | The value of the cell. |
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 1 | Col 2 | Col 3 |
10 | -20 | 30 |
12 | 21 |
1234 |
1234 | 5 |
1 | 2345 |
|
|
|