<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>table</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="../../style.css" type="text/css" /> <link rel="stylesheet" href="../../local.css" type="text/css" /> <meta name="robots" content="noindex, follow" /> </head> <body> <div class="page"> <div class="pageheader"> <div class="header"> <span> <span class="parentlinks"> <a href="../../index.html">ikiwiki</a>/ <a href="../../ikiwiki.html">ikiwiki</a>/ <a href="../directive.html">directive</a>/ </span> <span class="title"> table </span> </span> </div> </div> <div id="pagebody"> <div id="content" role="main"> <p>The <code>table</code> directive is supplied by the <a href="http://ikiwiki.info/plugins/table/">table</a> plugin.</p> <p>This directive can build HTML tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format.</p> <h2>examples</h2> <pre><code>[[!table data=""" Customer |Amount Fulanito |134,34 Menganito|234,56 Menganito|234,56 """]] [[!table class="book_record" format=csv file="data/books/record1"]] </code></pre> <p>In this second example the <code>record1</code> page should be similar to:</p> <pre><code>"Title","Perl Best Practices" "Author","Damian Conway" "Publisher","O’Reilly" </code></pre> <p>To make a cell span multiple columns, follow it with one or more empty cells. For example:</p> <pre><code>[[!table data=""" left||right| a|b|c|d this cell spans **4** columns||| """]] </code></pre> <h2>usage</h2> <ul> <li><code>data</code> - Values for the table.</li> <li><code>file</code> - A file in the wiki containing the data.</li> <li><code>format</code> - The format of the data, either "csv", "dsv", or "auto" (the default).</li> <li><code>delimiter</code> - The character used to separate fields. By default, DSV format uses a pipe (<code>|</code>), and CSV uses a comma (<code>,</code>).</li> <li><code>class</code> - A CSS class for the table html element.</li> <li><code>header</code> - By default, or if set to "row", the first data line is used as the table header. Set it to "no" to make a table without a header, or "column" to make the first column be the header.</li> </ul> <p>For tab-delimited tables (often obtained by copying and pasting from HTML or a spreadsheet), <code>delimiter</code> must be set to a literal tab character. These are difficult to type in most web browsers - copying and pasting one from the table data is likely to be the easiest way.</p> <p>Note that the contents of table cells can contain arbitrary ikiwiki and markdown markup.</p> </div> </div> <div id="footer" class="pagefooter" role="contentinfo"> <div id="pageinfo"> <div id="backlinks"> Links: <a href="../../plugins/table.html">plugins/table</a> </div> <div class="pagedate"> Last edited <span class="date">Tue Feb 26 23:01:54 2019</span> <!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> --> </div> </div> <!-- from ikiwiki --> </div> </div> </body> </html>