1 [[template id=plugin name=table author="[[VictorMoral]]"]]
4 This plugin supplies a `table` [[PreprocessorDirective]] to build html tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format.
6 It needs the perl module [[cpan Text::CSV]] for the CSV data.
10 In any source page include the following:
12 The next table shows the results:
14 \[[table class="myclass" format=dsv data="""
20 This is my last acquisition:
22 [[table class="book_record" format=csv file="data/books/record1"]]
24 And the record1 page should be similar to:
26 "Title","Perl Best Practices"
27 "Author","Damian Conway"
28 "Publisher","O’Reilly"
32 - _data_: Values for the table
33 - _file_: Wiki page containing the data.
34 - _format_ (optional): format name of the data. By default is `auto` and the options are `csv` or `dsv`.
35 - _delimiter_ (optional): The character used to separate fields. By default, DSV format uses a pipe (`|`), and CSV uses a comma (`,`).
36 - _class_ (optional): CSS class for the table html element
37 - _caption_ (optional): Text string for the table caption.
38 - _no\_header_: This switch disables the generation of table header (`<th>`) elements. By default, the `table` directive uses the first data line as column headers.
40 The _data_ and _file_ parameters are mutually exclusive.
42 Note: the automatic format detection mechanism is still very rudimentary.
48 * Remove a call to an inexistent [[cpan Text::CSV]] method.
49 * Added the sep_char parameter.
50 * Parse CSV data in binary mode.
51 * Added a format detection mechanism.
52 * Default format now is 'auto'.
56 - Information about the formats in Wikipedia:
60 - Download the tar file from <http://taquiones.net/files/misc/>
61 - Debian package in <http://taquiones.net/files/debian/>