]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FMediawikiTablePlugin
Small syntax fix
[SourceForge/phpwiki.git] / pgsrc / Help%2FMediawikiTablePlugin
1 Date: Mon, 2 Feb 2009 5:18:24 +0100
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FMediawikiTablePlugin;
6   flags=PAGE_LOCKED;
7   markup=2;
8   charset=iso-8859-1
9 Content-Transfer-Encoding: binary
10
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.
13
14 == Mediawiki table syntax
15
16 * The table starts with a line <b>{~|</b> and ends with a line <b>|~}</b>.
17 * An optional table caption is made with a line starting with a pipe and a plus sign <b>|+</b> followed by the caption.
18 * An optional table summary is made with a line starting with a pipe and an equal sign <b>|=</b> followed by the summary.
19 * A table row starts with a pipe and a hyphen: <b>|-</b>.
20 * A table cell starts with a pipe on a new line, or a double bar <b>||</b> on the same line.
21 * A header table cell starts with an exclamation mark, or a double exclamation mark <b>!!</b> on the same line.
22
23 The summary syntax is an extension to the Mediawiki syntax. 
24 You can also simply put the summary as an attribute to the table.
25 The summary is necessary to be able to create accessible tables.
26
27 === HTML attributes
28
29 <?plugin RichTable
30 * class="bordered"
31 - style="font-weight:bold;background-color:#d8d8d8;", align=center
32 |
33 Attribute
34 |
35 Syntax
36 -
37 |
38 For the table
39 |
40 {| border="1"
41 -
42 |
43 For the caption
44 |
45 ~|+ style="font-weight: bold;"
46 -
47 |
48 For a row
49 |
50 ~|- style="height:100px"
51 -
52 |
53 For a cell
54 |
55 ~| align="right" | Cell 2 (right aligned)
56 ?>
57
58 The attributes might be put with or without double quotes.
59
60 == Examples
61
62 === Example 1: simple table
63
64 {| border="1", style="width: 100%"
65 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
66 |= This is the table summary
67 |- style="white-space: nowrap"
68 ! Header 1
69 ! Header 2
70 ! Header 3
71 |- style=height:100px
72 | Cell I
73 | <b>Cell II</b>,  in bold
74 |align=right, width="100%" |Cell III
75 |- bgcolor=#f0f0ff, align=center
76 |Cell 1||Cell 2||Cell 3
77 |}
78
79 The above table is rendered from:
80
81 <verbatim>
82 {| border="1", style="width: 100%"
83 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
84 |= This is the table summary
85 |- style="white-space: nowrap"
86 ! Header 1
87 ! Header 2
88 ! Header 3
89 |- style=height:100px
90 | Cell I
91 | <b>Cell II</b>,  in bold
92 |align=right, width="100%" |Cell III
93 |- bgcolor=#f0f0ff, align=center
94 |Cell 1||Cell 2||Cell 3
95 |}
96 </verbatim>
97
98 === Example 2: table with paragraphs, lists and plugins in cells
99
100 {|
101 |- style="white-space: nowrap"
102 ! Header 1
103 ! Header 2
104 |- bgcolor=yellow
105 | First paragraph.
106
107 Second paragraph.
108 |
109 * One
110 * Two
111 * Three
112 |- bgcolor=#f0f0ff, align=center
113 |Current date || <<CurrentTime format=date>>
114 |}
115
116 The above table is rendered from:
117
118 <verbatim>
119 {|
120 |- style="white-space: nowrap"
121 ! Header 1
122 ! Header 2
123 |- bgcolor=yellow
124 | First paragraph.
125
126 Second paragraph.
127 |
128 * One
129 * Two
130 * Three
131 |- bgcolor=#f0f0ff, align=center
132 |Current date || <<CurrentTime format=date>>
133 |}
134 </verbatim>
135
136 === Example 3: nested tables
137
138 <<MediawikiTable
139 {| class="bordered", align=center
140 |+ Outer table caption
141 |-
142 ! Header A !! Header B
143 |-
144 | A numbered list:
145 # one
146 # two
147 # three
148 |
149 This cell contains a nested table.
150  {| class="bordered"
151  |+ Inner table caption
152  |-
153  ! Header A
154  ! Header B
155  |-
156  | Inner A1
157  | Inner B1
158  |-
159  | Inner A2
160  | Inner B2
161  |}
162 |-
163 | A paragraph
164
165 Another paragraph
166
167 | A plain list:
168 * apple
169 * pear
170 * apricot
171 |}
172 >>
173
174 The above table is rendered from:
175
176 <verbatim>
177 <<MediawikiTable
178 {| class="bordered", align=center
179 |+ Outer table caption
180 |-
181 ! Header A !! Header B
182 |-
183 | A numbered list:
184 # one
185 # two
186 # three
187 |
188 This cell contains a nested table.
189  {| class="bordered"
190  |+ Inner table caption
191  |-
192  ! Header A
193  ! Header B
194  |-
195  | Inner A1
196  | Inner B1
197  |-
198  | Inner A2
199  | Inner B2
200  |}
201 |-
202 | A paragraph
203
204 Another paragraph
205
206 | A plain list:
207 * apple
208 * pear
209 * apricot
210 |}
211 >>
212 </verbatim>
213
214 == Author
215
216 Marc-Etienne Vargenau, Alcatel-Lucent
217
218 == See Also
219 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
220
221 ----
222 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]