1 Date: Thu, 11 Jun 2009 20:56:23 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
4 Content-Type: application/x-phpwiki;
5 pagename=Help%2FMediawikiTablePlugin;
6 flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
9 Content-Transfer-Encoding: binary
11 The **~MediawikiTable** [[Help:WikiPlugin|plugin]] allows a user to specify a ##<table>## with (a subset of) the syntax used by Mediawiki.
12 The plugin is not meant to be called directly, just use the syntax below to insert your table.
14 == Mediawiki table syntax
16 * The table starts with a line ##{|##.
17 * An optional table caption is made with a line starting with a pipe and a plus sign ##|+## followed by the caption.
18 * An optional table summary is made with a line starting with a pipe and an equal sign ##|=## followed by the summary.
19 * A table row starts with a pipe and a hyphen: ##|-##.
20 * A table cell starts with a pipe on a new line, or a double bar ##||## on the same line.
21 * A header table cell starts with an exclamation mark, or a double exclamation mark ##!!## on the same line.
22 * The table ends with a line ##|}##.
24 The summary syntax is an extension to the Mediawiki syntax.
25 You can also simply put the summary as an attribute to the table.
26 The summary is necessary to be able to create accessible tables.
36 | {{{ {| border="1" }}}
39 | {{{ |+ style="font-weight: bold;" }}}
42 | {{{ |- style="height:100px" }}}
45 | {{{ | align="right" | Cell 2 (right aligned) }}}
48 The attributes might be put with or without double quotes.
50 === Predefined CSS classes
52 If you do not specify a class for the table, it will be rendered without border.
54 ==== Boxed and bordered tables
56 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
58 If you specify ##class="bordered"##, you will have a border around the table and the cells
60 In both cases, the caption (if any) will be bold and centered under the table
62 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
66 If you specify ##class="sortable"##, the table columns will be sortable.
70 === Example 1: simple table
72 {| border="1" style="width: 100%"
73 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
74 |= This is the table summary
75 |- style="white-space: nowrap"
81 | **Cell II**, in bold
82 |align=right, width="100%" |Cell III
83 |- bgcolor=#f0f0ff, align=center
84 |Cell 1||Cell 2||Cell 3
87 The above table is rendered from:
90 {| border="1" style="width: 100%"
91 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
92 |= This is the table summary
93 |- style="white-space: nowrap"
99 | **Cell II**, in bold
100 |align=right, width="100%" |Cell III
101 |- bgcolor=#f0f0ff, align=center
102 |Cell 1||Cell 2||Cell 3
106 === Example 2: table with paragraphs, lists and plugins in cells
109 |- style="white-space: nowrap"
120 |- bgcolor=#f0f0ff, align=center
121 |Current date || <<CurrentTime format=date>>
124 The above table is rendered from:
128 |- style="white-space: nowrap"
139 |- bgcolor=#f0f0ff, align=center
140 |Current date || <<CurrentTime format=date>>
144 === Example 3: sortable table
146 Click on a column header to sort the column.
147 Clicking a second time will reverse the sorting order.
149 {| class="bordered sortable"
151 ! First name !! Name !! Age
153 | John || Smith || 35
155 | Albert || Wells || 5
160 The above table is rendered from:
163 {| class="bordered sortable"
165 ! First name !! Name !! Age
167 | John || Smith || 35
169 | Albert || Wells || 5
175 === Example 4: nested tables
178 {| class="bordered" align=center
179 |+ Outer table caption
181 ! Header A !! Header B
188 This cell contains a nested table.
190 |+ Inner table caption
213 The above table is rendered from:
217 {| class="bordered" align=center
218 |+ Outer table caption
220 ! Header A !! Header B
227 This cell contains a nested table.
229 |+ Inner table caption
255 Marc-Etienne Vargenau, Alcatel-Lucent
258 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
262 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]