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