<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnTables</title></articleinfo><section><title>Table Markup</title><para><!--The macro TableOfContents doesn't work with the DocBook formatter.--> To create a table, start &amp; end a new line using the table marker; two 'pipe' characters  &quot;<code>||</code>&quot;. Between those start and end markers, you can create any number of cells by separating them with &quot;<code>||</code>&quot;. In the most basic example, here is a four-square table: </para><screen><![CDATA[|| top left cell || top right cell ||
|| bottom left cell || bottom right cell ||]]></screen><para>Yields: </para><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> top left cell </para></entry><entry colsep="1" rowsep="1"><para> top right cell </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para> bottom left cell </para></entry><entry colsep="1" rowsep="1"><para> bottom right cell </para></entry></row></tbody></tgroup></informaltable><section><title>Table Attributes</title><para>Of course, undoubtedly the time will come when you want a bit formatting. Moin tables can be formatted with many HTML table attributes. Any attributes have to be placed between angle brackets <code>&lt;...&gt;</code> directly after the cell marker. For example: <code>||&lt;style&quot;...&quot;&gt; cell content ||</code> </para><para>The style stuff is <emphasis>all you need</emphasis> for styling your tables. Just use CSS-formatted styles and it will be inlined in the generated HTML tag.  </para><itemizedlist><listitem><para><code>&lt;style=&quot;...&quot;&gt;</code> will put that style info into cell (td) html </para></listitem><listitem><para><code>&lt;rowstyle=&quot;...&quot;&gt;</code> will put that style info into row (tr) html </para></listitem><listitem><para><code>&lt;tablestyle=&quot;...&quot;&gt;</code> will put that style info into table (table) html </para></listitem></itemizedlist><para>We still support the old table markup, but generate the effect by appending additional values to the <code>style</code> parameter: </para><para>Cell &amp; table widths: </para><itemizedlist><listitem><para><code>&lt;50%&gt;</code>: cell width (will append <code>width: 50%;</code> to style) </para></listitem><listitem><para><code>&lt;width=&quot;50%&quot;&gt;</code>: does the same </para></listitem><listitem><para><code>&lt;tablewidth=&quot;100%&quot;&gt;</code>: set table width to 100% (only valid in first table row) </para></listitem></itemizedlist><para>Spanning cells: </para><itemizedlist><listitem><para><code>&lt;-2&gt;</code>: column span </para></listitem><listitem><para><code>&lt;|2&gt;</code>: row span </para></listitem></itemizedlist><para>Text alignment: </para><itemizedlist><listitem><para><code>&lt;(&gt;</code>: left aligned (will append <code>text-align: left;</code> to style) </para></listitem><listitem><para><code>&lt;:&gt;</code>: centered (will append <code>text-align: center;</code> to style) </para></listitem><listitem><para><code>&lt;)&gt;</code>: right aligned (will append <code>text-align: right;</code> to style) </para></listitem><listitem><para><code>&lt;^&gt;</code>: aligned to top (will append <code>vertical-align: top;</code> to style) </para></listitem><listitem><para><code>&lt;v&gt;</code>: aligned to bottom (will append <code>vertical-align: bottom;</code> to style) </para></listitem></itemizedlist><para>Coloring: </para><itemizedlist><listitem><para><code>&lt;#XXXXXX&gt;</code>: background color (will append <code>background-color: #XXXXXX;</code> to style) </para></listitem><listitem><para><code>&lt;bgcolor=&quot;#XXXXXX&quot;&gt;</code> does the same </para></listitem><listitem><para><code>&lt;rowbgcolor=&quot;#XXXXXX&quot;&gt;</code> set row background color (only valid in first cell) </para></listitem><listitem><para><code>&lt;tablebgcolor=&quot;#XXXXXX&quot;&gt;</code> set table background color </para></listitem></itemizedlist><para>If you use several conflicting options like <code>&lt;(:)&gt;</code>, the last option wins. There is no explicit option for vertical centering (<emphasis>middle</emphasis>), since that is always the default. </para><section><title>Leveraging CSS in your tables</title><para>Alternatively, the admin or the user (the admin in the theme css file, or the user can extend moin's CSS by his own definitions via user preferences) can refer to them using class or id. You can use several options at the same time by writing them one after the other within the same angle brackets (e.g. <code>&lt;tablestyle=&quot;...&quot; rowstyle=&quot;...&quot;&gt;</code> on the first cell, to set both the table-wide style and the first-row style. </para><itemizedlist><listitem><para><code>&lt;class=&quot;...&quot;&gt;</code> will put that CSS class into cell (td) html </para></listitem><listitem><para><code>&lt;rowclass=&quot;...&quot;&gt;</code> will put that CSS class into row (tr) html </para></listitem><listitem><para><code>&lt;tableclass=&quot;...&quot;&gt;</code> will put that class into table (table) html </para></listitem><listitem><para><code>&lt;id=&quot;...&quot;&gt;</code> will put that CSS id into cell (td) html </para></listitem></itemizedlist></section></section><section><title>Examples</title><section><title>General table layout and HTML like options</title><screen><![CDATA[New Style:
||||||<tablestyle="width: 80%">'''Heading'''||
||cell 1||cell2||cell 3||
||<rowspan=2> spanning rows||||<style="background-color: #E0E0FF;"> spanning 2 columns||
||<rowstyle="background-color: #FFFFE0;">cell2||cell 3||
]]><![CDATA[
Old Style:
||||||<tablewidth="80%">'''Heading'''||
||cell 1||cell2||cell 3||
||<rowspan=2> spanning rows||||<bgcolor="#E0E0FF"> spanning 2 columns||
||<rowbgcolor="#FFFFE0">cell2||cell 3||]]></screen><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry align="center" colsep="1" nameend="col_2" namest="col_0" rowsep="1"><para><emphasis role="strong">Heading</emphasis></para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>cell 1</para></entry><entry colsep="1" rowsep="1"><para>cell2</para></entry><entry colsep="1" rowsep="1"><para>cell 3</para></entry></row><row rowsep="1"><entry colsep="1" morerows="1" rowsep="1"><para> spanning rows</para></entry><entry align="center" colsep="1" nameend="col_2" namest="col_1" rowsep="1"><para> spanning 2 columns</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>cell2</para></entry><entry colsep="1" rowsep="1"><para>cell 3</para></entry></row></tbody></tgroup></informaltable></section><section><title>Cell width</title><screen><![CDATA[New Style
|| narrow ||<style="width: 99%; text-align: center;"> wide ||
]]><![CDATA[
Old Style
|| narrow ||<:99%> wide ||]]></screen><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1" colwidth="99*"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> narrow </para></entry><entry align="center" colsep="1" rowsep="1"><para> wide </para></entry></row></tbody></tgroup></informaltable></section><section><title>Spanning rows and columns</title><screen><![CDATA[||<|2> 2 rows || row 1 ||
|| row 2 ||
||<-2> row 3 over 2 columns ||]]></screen><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry align="center" colsep="1" morerows="1" nameend="col_0" namest="col_0" rowsep="1"><para> 2 rows </para></entry><entry colsep="1" rowsep="1"><para> row 1 </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para> row 2 </para></entry></row><row rowsep="1"><entry colsep="1" nameend="col_1" namest="col_0" rowsep="1"><para> row 3 over 2 columns </para></entry></row></tbody></tgroup></informaltable></section><section><title>Alignment</title><screen><![CDATA[||<style="text-align: left;">left ||<style="vertical-align: top; text-align: center;"|3> top ||<style="vertical-align: bottom;"|3> bottom ||
||<style="text-align: center;"> centered ||
||<style="text-align: right;"> right ||
]]><![CDATA[
old style:
||<(> left ||<^|3> top ||<v|3> bottom ||
||<:> centered ||
||<)> right ||]]></screen><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry align="left" colsep="1" rowsep="1"><para>left </para></entry><entry align="center" colsep="1" morerows="2" nameend="col_1" namest="col_1" rowsep="1" valign="top"><para> top </para></entry><entry align="center" colsep="1" morerows="2" nameend="col_2" namest="col_2" rowsep="1" valign="bottom"><para> bottom </para></entry></row><row rowsep="1"><entry align="center" colsep="1" rowsep="1"><para> centered </para></entry></row><row rowsep="1"><entry align="right" colsep="1" rowsep="1"><para> right </para></entry></row></tbody></tgroup></informaltable></section><section><title>Fonts</title><screen><![CDATA[|| normal ||<style="font-weight: bold;"> bold ||<style="color: #FF0000;"> red ||<style="color: #FF0000; font-weight: bold;"> boldred ||]]></screen><informaltable><tgroup cols="4"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><colspec colname="col_3"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> normal </para></entry><entry colsep="1" rowsep="1"><para> bold </para></entry><entry colsep="1" rowsep="1"><para> red </para></entry><entry colsep="1" rowsep="1"><para> boldred </para></entry></row></tbody></tgroup></informaltable></section><section><title>Colors</title><screen><![CDATA[New style
||<style="background-color: red;"> red ||<style="background-color: green;"> green ||<style="background-color: blue;"> blue ||
old Style
||<#FF8080> red ||<#80FF80> green ||<#8080FF> blue ||]]></screen><informaltable><tgroup cols="3"><colspec colname="col_0"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> red </para></entry><entry colsep="1" rowsep="1"><para> green </para></entry><entry colsep="1" rowsep="1"><para> blue </para></entry></row></tbody></tgroup></informaltable></section><section><title>Line breaks within cells</title><screen><![CDATA[|| line 1<<BR>>line 2||]]></screen><informaltable><tgroup cols="1"><colspec colname="col_0"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> line 1</para><para>line 2</para></entry></row></tbody></tgroup></informaltable></section><section><title>No border style</title><screen><![CDATA[||<style="border:none;"> line 1||
||<style="border:none;"> line 2||]]></screen><informaltable><tgroup cols="1"><colspec colname="col_0"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para> line 1</para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para> line 2</para></entry></row></tbody></tgroup></informaltable></section></section><section><title>Insert Table Data from other sources</title><itemizedlist><listitem><para>comma separated values: see <ulink url="https://wiki.math.uzh.ch/public/HelpOnTables/public/HelpOnParsers#csvparser">HelpOnParsers#csvparser</ulink> </para></listitem><listitem><para>include wiki pages: see <ulink url="https://wiki.math.uzh.ch/public/HelpOnTables/public/HelpOnMacros/Include#">Include</ulink> </para></listitem></itemizedlist></section><section><title>Bulleted lists and other complex content within cells</title><para><inlinemediaobject><imageobject><imagedata fileref="https://wiki.math.uzh.ch/public/HelpOnTables?action=AttachFile&amp;do=get&amp;target=MiniPage.png"/></imageobject><textobject><phrase>MiniPage.png</phrase></textobject></inlinemediaobject> </para><itemizedlist><listitem><para>see <ulink url="http://moinmo.in/MacroMarket/MiniPage#">MiniPage macro</ulink> </para></listitem></itemizedlist></section></section></article>