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