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