Loading...
 
Skip to main content

History: PluginMWTable

Source of version: 11 (current)

Copy to clipboard
            ! Plugin Media Wiki Table
''Introduced in ((Tiki3))''

Use this ((wiki plugin)) to display a table using MediaWiki syntax.

!!Parameters
{pluginmanager plugin="mwtable"}
!! Usage notes
This plugin doesn't support things like templates or the !row heading syntax. Column styling overcomes the latter to a degree but, for cross-browser consistency, you are limited by HTML to -+border=+- , -+background=+- , -+width=+- and -+visibility=+- .  You can also use -+span=+- so that a -+col+- definition can apply to adjacent columns. -+tr+- and -+td+- styling overrides -+col+- .
!!! Structure of data
* Optionally, first line (prior to the first -+|+- ) contains html attributes for the table element.
* Optionally, next line can specify a caption; line starts with -+|++- followed by optional html attributes that end with a -+|+- followed by the caption text.
* Optionally, html attributes for col elements can be specified next on one or more lines starting with a -+?+- 
* Each column's attributes start on a new line with -+?+- or on the same line preceded by -+??+- and become a -+col+- 
* Optionally, column headings can be specified next on one or more lines starting with a -+!+- 
* Each column's heading starts on a new line with -+!+- or on the same line preceded by -+!!+-
* Optional html attributes for -+th+- end with a -+|+- followed by text that becomes the text of a -+th+-
* Each row, including the first, starts on a new line with -+|-+- , optionally followed by html attributes for the -+tr+- element
* Each cell starts on a new line with -+|+- or on the same line preceded by -+~124~~124~+-
* Optional html attributes for the -+td+- element end with a -+|+- followed by the cell text (so data for one cell can have 1 or 2 | characters.  Any other -+|+- characters are assumed to be part of the cell text.)
!!Examples
!!!Basic syntax:
{CODE(colors="tiki")}
{MWTABLE(fancy="" wiki_classes="")}data{MWTABLE}
{CODE}
!!! The minimum
''This code:''
{CODE(colors="tiki")}
{MWTABLE()} 
|-
| Bill || The little house
|-
| Carol || The big house
{MWTABLE}
{CODE}

''Would produce:''
{CODE(colors="htmlmixed")}
<table class="wikitable">
<tr>
<td class="wikicell">Bill</td>
<td class="wikicell">The little house</td>
</tr>
<tr>
<td class="wikicell">Carol</td>
<td class="wikicell">The big house</td>
</tr>
</table>
{CODE}

As a reference, under -+tikineat.css+- style, it shows as:
^::{img src="img/wiki_up/plugin_mwtable_01.png" }::^
 
!!! Include styling
''This code:''
{CODE(colors="null")}
{MWTABLE( wiki_classes="false")} style="width:50%", class="myclass"
|+style="font-style:italic;"|My caption
? width="30%;" ?? style="background-color:yellow;"
! style="background-color:grey;"| Name
! Address
|- style="background-color: red"
| style="color: blue;" | Bill
| The little house
|-
| Carol || The big house
{MWTABLE}
{CODE}

''Would produce:''
{CODE(colors="htmlmixed")}
<table style="width:50%;" class="normal myclass">
<caption style="font-style:italic;">
My caption</caption>
<col style="width:30%;"/>
<col style="background-color:yellow;"/>
<tr>
<th style="background-color:grey;color:red;">Name</th>
<th>Address</th>
</tr>
<tr style="background-color:red;">
<td style="color:blue;">Bill</td>
<td class="">The little house</td>
</tr>
<tr>
<td>Carol</td>
<td>The big house</td>
</tr>
</table>{CODE}

As a reference, under -+tikineat.css+- style, it shows as:
^::{img src="img/wiki_up/plugin_mwtable_02.png" }::^