]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FMediawikiTablePlugin
Add link
[SourceForge/phpwiki.git] / pgsrc / Help%2FMediawikiTablePlugin
1 Date: Tue,  9 Nov 2010 14:24:02 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC1)
3 X-Rcs-Id: $Id$
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FMediawikiTablePlugin;
6   flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
7   markup=2;
8   charset=UTF-8
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 ##{|##.
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 ##|}##.
23
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.
27
28 If the first row of the table as made with header cells only, this row will be put in a //thead//.
29 In that case, this row will be repeated on every page when printing the table.
30
31 === HTML attributes ===
32
33 {| class="bordered"
34 |-
35 ! Attribute
36 ! Syntax
37 |-
38 | For the table
39 | {{{ {| border="1" }}}
40 |-
41 | For the caption
42 | {{{ |+ style="font-weight: bold;" }}}
43 |-
44 | For a row
45 | {{{ |- style="height:100px" }}}
46 |-
47 | For a cell
48 | {{{ | align="right" | Cell 2 (right aligned) }}}
49 |}
50
51 The attributes might be put with or without double quotes.
52
53 === Predefined CSS classes ===
54
55 If you do not specify a class for the table, it will be rendered without border.
56
57 ==== Boxed and bordered tables ====
58
59 If you specify ##class="boxed"##, you will have a border around the table (but not around the cells).
60
61 If you specify ##class="bordered"##, you will have a border around the table and the cells
62
63 In both cases, the caption (if any) will be bold and centered under the table
64
65 In both cases, the headers (specified by ##!##) will have a ##"#d8d8d8"## background
66
67 ==== Sortable tables ====
68
69 If you specify ##class="sortable"##, the table columns will be sortable.
70
71 ==== Do not break table when printing ====
72
73 If you specify ##class="nobreak"##, the table will not be cut when printed (if your browser supports it).
74
75 == Examples ==
76
77 === Example 1: simple table ===
78
79 {| border="1" style="width: 100%"
80 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
81 |= This is the table summary
82 |- style="white-space: nowrap"
83 ! Header 1
84 ! Header 2
85 ! Header 3
86 |- style=height:100px
87 | Cell I
88 | **Cell II**,  in bold
89 |align=right width="100%" |Cell III
90 |- bgcolor=#f0f0ff align=center
91 |Cell 1||Cell 2||Cell 3
92 |}
93
94 The above table is rendered from:
95
96 {{{
97 {| border="1" style="width: 100%"
98 |+ style="font-weight: bold; font-size: 150%;" | This is the table caption
99 |= This is the table summary
100 |- style="white-space: nowrap"
101 ! Header 1
102 ! Header 2
103 ! Header 3
104 |- style=height:100px
105 | Cell I
106 | **Cell II**,  in bold
107 |align=right width="100%" |Cell III
108 |- bgcolor=#f0f0ff align=center
109 |Cell 1||Cell 2||Cell 3
110 |}
111 }}}
112
113 === Example 2: table with paragraphs, lists and plugins in cells ===
114
115 {|
116 |- style="white-space: nowrap"
117 ! Header 1
118 ! Header 2
119 |- bgcolor=yellow
120 | First paragraph.
121
122 Second paragraph.
123 |
124 * One
125 * Two
126 * Three
127 |- bgcolor=#f0f0ff align=center
128 |Current date || <<CurrentTime format=date>>
129 |}
130
131 The above table is rendered from:
132
133 {{{
134 {|
135 |- style="white-space: nowrap"
136 ! Header 1
137 ! Header 2
138 |- bgcolor=yellow
139 | First paragraph.
140
141 Second paragraph.
142 |
143 * One
144 * Two
145 * Three
146 |- bgcolor=#f0f0ff align=center
147 |Current date || <<CurrentTime format=date>>
148 |}
149 }}}
150
151 === Example 3: sortable table ===
152
153 Click on a column header to sort the column.
154 Clicking a second time will reverse the sorting order.
155
156 {| class="bordered sortable"
157 |-
158 ! First name !! Name !! Age
159 |-
160 | John || Smith || 35
161 |-
162 | Albert || Wells || 5
163 |-
164 | Sam || Adam || 102
165 |}
166
167 The above table is rendered from:
168
169 {{{
170 {| class="bordered sortable"
171 |-
172 ! First name !! Name !! Age
173 |-
174 | John || Smith || 35
175 |-
176 | Albert || Wells || 5
177 |-
178 | Sam || Adam || 102
179 |}
180 }}}
181
182 === Example 4: nested tables ===
183
184 <<MediawikiTable
185 {| class="bordered" align=center
186 |+ Outer table caption
187 |-
188 ! Header A !! Header B
189 |-
190 | A numbered list:
191 # one
192 # two
193 # three
194 |
195 This cell contains a nested table.
196  {| class="bordered"
197  |+ Inner table caption
198  |-
199  ! Header A
200  ! Header B
201  |-
202  | Inner A1
203  | Inner B1
204  |-
205  | Inner A2
206  | Inner B2
207  |}
208 |-
209 | A paragraph
210
211 Another paragraph
212
213 | A plain list:
214 * apple
215 * pear
216 * apricot
217 |}
218 >>
219
220 The above table is rendered from:
221
222 {{{
223 <<MediawikiTable
224 {| class="bordered" align=center
225 |+ Outer table caption
226 |-
227 ! Header A !! Header B
228 |-
229 | A numbered list:
230 # one
231 # two
232 # three
233 |
234 This cell contains a nested table.
235  {| class="bordered"
236  |+ Inner table caption
237  |-
238  ! Header A
239  ! Header B
240  |-
241  | Inner A1
242  | Inner B1
243  |-
244  | Inner A2
245  | Inner B2
246  |}
247 |-
248 | A paragraph
249
250 Another paragraph
251
252 | A plain list:
253 * apple
254 * pear
255 * apricot
256 |}
257 >>
258 }}}
259
260 == Author ==
261 * Marc-Etienne Vargenau, Alcatel-Lucent
262
263 == See Also ==
264 * [[http://meta.wikimedia.org/wiki/Help:Table|Mediawiki table help page]]
265
266 <noinclude>
267 ----
268 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]
269 </noinclude>