<?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>To create a table, you start and end a line using the table marker &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;. To get a centered cell that spans several columns, you start that cell with more than one cell marker. Adjacent lines of the same indent level containing table markup are combined into one table. </para><para>For more information on the possible markup, see <ulink url="http://wiki.ninux.org/HelpOnTables/HelpOnEditing#">HelpOnEditing</ulink>. </para><section><title>Table Attributes</title><para>Apart from the option to repeat cell markers to get columns spanning several other columns, you can directly set many HTML table attributes. Any attributes have to be placed between angle brackets <code>&lt;...&gt;</code> directly after the cell marker. </para><para>The wiki-like markup has the following options: </para><itemizedlist><listitem><para><code>&lt;-2&gt;</code>: colspan </para></listitem><listitem><para><code>&lt;|2&gt;</code>: rowspan </para></listitem><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><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><para>The style stuff is <emphasis>all you need</emphasis> for styling your tables. Just use CSS formatted style there and it will be inlined in the generated HTML tag. Alternatively, the admin and the user (the admin in the theme file, the user via UserPreferences can extend moin's CSS by his own definitions, so users 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><para>We still support the old table markup, but generate the effect by appending additional values to the <code>style</code> parameter: </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><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><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><section><title>Example</title><screen><![CDATA[ NEW STYLE: General table layout and HTML like options::
 ||||||<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||
 Cell width::
 || narrow ||<style="width: 99%; text-align: center;"> wide ||
 Spanning rows and columns::
 ||<|2> 2 rows || row 1 ||
 || row 2 ||
 ||<-2> row 3 over 2 columns ||
 Alignment::
 ||<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 ||
 Fonts::
 || normal ||<style="font-weight: bold;"> bold ||<style="color: #FF0000;"> red ||<style="color: #FF0000; font-weight: bold;"> boldred ||
 Colors::
 ||<style="background-color: red;"> red ||<style="background-color: green;"> green ||<style="background-color: blue;"> blue ||
]]><![CDATA[
 OLD STYLE: General table layout and HTML like options::
 ||||||<tablewidth="80%">'''Heading'''||
 ||cell 1||cell2||cell 3||
 ||<rowspan=2> spanning rows||||<bgcolor="#E0E0FF"> spanning 2 columns||
 ||<rowbgcolor="#FFFFE0">cell2||cell 3||
 Cell width::
 || narrow ||<:99%> wide ||
 Spanning rows and columns::
 ||<|2> 2 rows || row 1 ||
 || row 2 ||
 ||<-2> row 3 over 2 columns ||
 Alignment::
 ||<(> left ||<^|3> top ||<v|3> bottom ||
 ||<:> centered ||
 ||<)> right ||
 Colors::
 ||<#FF8080> red ||<#80FF80> green ||<#8080FF> blue ||
 Line breaks within cells::
 || line 1[[BR]]line 2||]]></screen></section><section><title>Display</title><glosslist><glossentry><glossterm>NEW STYLE: General table layout and HTML like options</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Cell width</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Spanning rows and columns</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Alignment</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Fonts</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Colors</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>OLD STYLE: General table layout and HTML like options</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Cell width</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Spanning rows and columns</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Alignment</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Colors</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry><glossentry><glossterm>Line breaks within cells</glossterm><glossdef><listitem override="none"><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></listitem></glossdef></glossentry></glosslist></section><section><title>Insert Table Data from other sources</title><itemizedlist><listitem><para>comma separated values: see <ulink url="http://wiki.ninux.org/HelpOnTables/HelpOnParsers#csvparser">HelpOnParsers#csvparser</ulink> </para></listitem><listitem><para>include wiki pages: see <ulink url="http://wiki.ninux.org/HelpOnTables/HelpOnMacros/Include#">Include</ulink> </para></listitem></itemizedlist></section><section><title>Bulleted lists and other complex content within cells</title><para><inlinemediaobject><imageobject><imagedata fileref="http://wiki.ninux.org//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://moinmoin.wikiwikiweb.de/MacroMarket/MiniPage#">MiniPage macro</ulink> </para></listitem></itemizedlist></section></section></article>