1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
;;; table.skb -- Skribe tables
;;;
;;; Copyright 2003, 2004 Manuel Serrano
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;; USA.
;*---------------------------------------------------------------------*/
;* Table ... */
;*---------------------------------------------------------------------*/
(section :title "Table" :file #t
(p [Tables are defined by the means of the ,(code "table") function.])
(doc-markup 'table
`((:border [The table border thickness.])
(:width ,[The ,(ref :mark "width") of the table.])
(:frame ,[Which parts of frame to render. Must be one of
,(code "none"), ,(code "above"), ,(code "below"),
,(code "hsides"), ,(code "vsides"), ,(code "lhs"),
,(code "rhs"), ,(code "box"), ,(code "border").])
(:rules ,[Rulings between rows and cols, Must be one of
,(code [none]), ,(code "rows"), ,(code "cols"), ,(code "header"),
,(code "all").])
(:cellstyle ,[The style of cells border. Must be either
,(code "collapse"), ,(code "separate"), or a length representing
the horizontal and vertical space separating the cells.])
(:cellpadding [A number of pixels around each cell.])
(:cellspacing [An optional number of pixels used to separate each
cell of the table. A negative uses the target default.])
(#!rest row... [The rows of the table. Each row must be
constructed by the ,(ref :mark "tr" :text (code "tr")) function.])))
(p [,(bold (emph (color :fg "red" "Note:"))) Tables rendering may be only
partially supported by graphical agents. For instance, the ,(code "cellstyle")
attribute is only supported by HTML engines supporting
,(ref :url "http://www.w3.org/TR/REC-CSS2/" :text "CSS2").])
;*--- table rows ------------------------------------------------------*/
(subsection :title "Table row"
(p [Table rows are defined by the ,(code "tr") function.])
(doc-markup 'tr
'((:bg [The background color of the row.])
(#!rest cell... [The row cells.]))))
;*--- Table cell ------------------------------------------------------*/
(subsection :title "Table cell"
(p [Two functions define table cells: ,(code "th") for header cells and
,(code "td") for plain cells.])
(doc-markup 'th
'((:bg [The background color of the cell.])
(:width ,[The ,(ref :mark "width") of the table.])
(:align [The horizontal alignment of the table cell
(,(tt "left"), ,(tt "right"), or ,(tt "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 ,(code "top"), ,(code "center"), ,(code "bottom").])
(:colspan [The number of columns that the cell expands to.])
(:rowspan [The number of columns that the cell spans over.])
(#!rest node [The value of the cell.]))
:writer-id 'tc
:ignore-args '(m)
:others '(td)))
;*--- Example ---------------------------------------------------------*/
(subsection :title "Example"
(example-produce
(example :legend "A table" (prgm :file "src/api17.skb"))
(disp (include "src/api17.skb")))))
;; @indent: (put 'doc-markup 'skribe-indent 'skribe-indent-function)@*
|