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