]> sipb.mit.edu Git - ikiwiki.git/blob - underlays/basewiki/directive/table.mdwn
0d1af124953bc564d4d830bc49c188dd31c0f6d5
[ikiwiki.git] / underlays / basewiki / directive / table.mdwn
1 The `table` directive is supplied by the [[!iki plugins/table]] plugin.
2
3 This directive can build HTML tables from data in CSV (comma-separated values)
4 or DSV (delimiter-separated values) format.
5
6 ## examples
7
8         \[[!table data="""
9         Customer|Amount
10         Fulanito|134,34
11         Menganito|234,56
12         Menganito|234,56
13         """]]
14     
15         \[[!table class="book_record" format=csv file="data/books/record1"]]
16
17 In this second example the `record1` page should be similar to:
18
19         "Title","Perl Best Practices"
20         "Author","Damian Conway"
21         "Publisher","O’Reilly"
22
23 To make a cell span multiple columns, follow it with one or more empty
24 cells. For example:
25
26         \[[!table data="""
27         left||right|
28         a|b|c|d
29         this cell spans 4 columns|||
30         """]]
31
32 ## usage
33
34 * `data` - Values for the table.
35 * `file` - A file in the wiki containing the data.
36 * `format` - The format of the data, either "csv", "dsv", or "auto"
37   (the default).
38 * `delimiter` - The character used to separate fields. By default,
39    DSV format uses a pipe (`|`), and CSV uses a comma (`,`).
40 * `class` - A CSS class for the table html element.
41 * `header` - By default, or if set to "row", the first data line is used
42   as the table header. Set it to "no" to make a table without a header, or
43   "column" to make the first column be the header.
44
45 [[!meta robots="noindex, follow"]]