3.13 Skribilo User Manual — Table
Contents↑ Standard Markups

Tables are defined by the means of the table function.

prototype
(table [:rulecolor] [:cellspacing] [:cellpadding] [:cellstyle 'collapse] [:rules 'none] [:frame 'none] [:width] [:border] [:&location] [:class] [:ident] row...)
optionenginesdescription
:identhtml lout latex context info xml The node identifier.
:classhtml lout latex context info xml The node class.
:borderhtml lout context info The table border thickness.
:widthhtml lout latex context info The width of the table.
:framehtml lout latex context info Which parts of frame to render. Must be one of none, above, below, hsides, vsides, lhs, rhs, box, border.
:ruleshtml lout latex context info Rulings between rows and cols, Must be one of none, rows, cols, header, all.
:cellstylehtml latex The style of cells border. Must be either collapse, separate, or a length representing the horizontal and vertical space separating the cells.
:cellpaddinghtml lout context info A number of pixels around each cell.
:cellspacinghtml An optional number of pixels used to separate each cell of the table. A negative uses the target default.
:rulecolorlout info The color of rules (see Section Frames and Colors).
argumentdescription
row...The rows of the table. Each row must be constructed by the trtr function.

Note: Table rendering may be only partially supported by graphical agents. For instance, the cellstyle attribute is only supported by HTML engines supporting CSS2.

3.13.1 Table Row

Table rows are defined by the tr function.

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

3.13.2 Table Cell

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

prototype
(th [:bg] [:rowspan 1] [:colspan 1] [:valign] [:align 'center] [:width] [:class] [:ident] node)
(td [:bg] [:rowspan 1] [:colspan 1] [:valign] [:align 'center] [:width] [:class] [:ident] node)
optionenginesdescription
:identhtml lout latex context info xml The node identifier.
:classhtml lout latex context info xml The node class.
:bghtml lout The background color of the cell.
:widthhtml lout latex context The width of the table.
:alignhtml lout latex context 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.)
:valignhtml lout latex context The vertical alignment of the cell. The value can be top, center, bottom.
:colspanhtml lout latex context The number of columns that the cell expands to.
:rowspanhtml lout The number of columns that the cell spans over.
argumentdescription
nodeThe value of the cell.

3.13.3 Example

(center
   (table :border 1 :width 50. :frame 'hsides :cellstyle 'collapse
      (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. 18: A table

... produces:

A table
Col 1Col 2Col 3
10-2030
1221
1234
12345
12345
(made with skribilo)