Help:Table
Help: | Contents | Getting Started | New to BRWiki | Editing BRWiki | Editing BRWiki (advanced) | Communication and Community | Additional Help |
The help pages are currently being redesigned so they are more helpful. If you have any comments or are interested in helping out, please see the help team. |
This article or section needs to be cleaned up to a higher standard of quality.
style="Template:stub explanationcss;" |
This may include editing to correct spelling and grammar, rewriting sections to ensure they are clear and concise, and wikifying.
This may include editing to correct spelling and grammar, rewriting sections to ensure they are clear and concise, and wikifying.
- XHTML
- HTML and wiki <td> syntax
- pipe-syntax
All three are supported by MediaWiki and create valid HTML output.
See also HTML element#Tables. Note however that the
thead
, tbody
, tfoot
, and colgroup
elements are currently not supported in MediaWiki.[top]Overview
XHTML | HTML & Wiki-td | Wiki-pipe | |||||||
---|---|---|---|---|---|---|---|---|---|
Table | <table></table> | <table></table> | class="bbcode_container" |
Code:
[noparse]{| params | ||||||
Caption | <caption></caption> | <caption></caption> | |+ caption | ||||||
Row | <tr></tr> | <tr> | |- params | ||||||
Data cell | <td>cell1</td> <td>cell2</td> | <td>cell1 <td>cell2 | class="bbcode_container" |
Code:
[noparse]| cell1 | ||||||
Data cell | <td>cell1</td> <td>cell2</td> <td>cell3</td> | <td>cell1 <td>cell2 <td>cell3 | |cell1||cell2||cell3 | ||||||
Header cell | <th></th> | <th> | ! heading | ||||||
Sample table |
| ||||||||
class="bbcode_container" |
Code:
[noparse] | class="bbcode_container" |
Code:
[noparse] | class="bbcode_container" |
Code:
[noparse] | |||||||
Sample table |
| ||||||||
class="bbcode_container" |
Code:
[noparse] | class="bbcode_container" |
Code:
[noparse] | class="bbcode_container" |
Code:
[noparse] | |||||||
Pros |
|
|
| ||||||
Cons |
|
|
| ||||||
XHTML | HTML & Wiki-td | Wiki-pipe |
[top]Guide to the pipe syntax
The pipe syntax, developed by Magnus Manske, substitutes pipes (|) for HTML. There is an on-line script which converts html tables to pipe syntax tables.
The pipes must start at the beginning of a new line, except when separating parameters from content or when using
The pipes must start at the beginning of a new line, except when separating parameters from content or when using
||
to separate cells on a single line. The parameters are optional.
[top]Tables
A table is defined by
{| ''params''
|}
which equals
<table ''params''>Insert non-formatted text here
</table>
{| ''params''
|}
which equals
<table ''params''>Insert non-formatted text here
</table>
Careful: You must include the space between
cell1 | cell2 | cell3 or like this: | cell1 | cell2 | cell3 which both equal | cell1 | cell2 | cell3 | cell1 | cell2 | cell3 which will result in | params>[top]HeadersFunctions the same way as TD, except "!" is used instead of the opening "|". "!!" can be used instead of "||". Parameters still use "|", though! Example: | params!cell1[top]CaptionsA |
---|
[top]Simple example
class="bbcode_container" |
generatesCode:
{|
| Cell 1, row 1
| Cell 2, row 1
|-
| Cell 1, row 2
| Cell 2, row 2
|}
Cell 1, row 1 | Cell 2, row 1 |
Cell 1, row 2 | Cell 2, row 2 |
[top]Advanced example
class="bbcode_container" |
Code:
{| align=right border=1
| Cell 1, row 1
|rowspan=2| Cell 2, row 1 (and 2)
| Cell 3, row 1
|-
| Cell 1, row 2
| Cell 3, row 2
|}
Cell 1, row 1 | Cell 2, row 1 (and 2) | Cell 3, row 1 |
Cell 1, row 2 | Cell 3, row 2 |
[top]Nested table
class="bbcode_container" |
gives a nested tableCode:
{| border=1
| α
|
{| bgcolor=#ABCDEF border=2
|nested
|-
|table
|}
|the original table again
|}
α |
| the original table again |
[top]Text next to a table
You can use various codes to float the table to the left or the right of text. Traditional HTML uses
An example of what not to do:
To prevent this, use {{clr}} to clear both sides, {{clrr}} to clear the right, or {{clrl}} to clear the left. This will place all following text (include more tables) after any floated elements:
align=left
or align=right
. You can also use style="float: left;"
or style="float:right;"
. However, be careful when using this in tandem with preformatted text. It may overlap the table because it does not wrap.An example of what not to do:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur velit pede, imperdiet id, pellentesque ut, aliquam sed, nunc. Duis condimentum bibendum felis. Aliquam sed leo. Nunc volutpat volutpat massa. Curabitur luctus mauris eget urna. Donec dictum. Fusce a turpis. Nullam sodales fringilla neque. Aenean nibh. Donec viverra purus et est. Integer at enim molestie nulla fringilla imperdiet. Nam dictum rutrum eros. Sed ut diam. Etiam et elit. Praesent ut tellus. Nullam vel sem.
Multiplication table × 1 2 3 1 1 2 3 2 2 4 6 3 3 6 9 4 4 8 12 5 5 10 15
Sed luctus arcu nec nulla. Sed dictum rhoncus leo. Praesent fringilla, nunc ut hendrerit tempus, nibh sem venenatis sapien, vitae tempor lorem turpis eu justo. Vestibulum a nibh. Sed interdum. Suspendisse potenti. Fusce a nibh. Aenean sed urna nec tellus porta hendrerit. Vestibulum felis velit, scelerisque non, pellentesque sed, ultricies vitae, nulla. Etiam vel ligula. In hac habitasse platea dictumst. Aliquam id ante vitae nulla dictum laoreet. Aliquam erat volutpat.
Pellentesque felis. Nullam nec dui. Sed odio. Curabitur bibendum elementum metus. Donec luctus velit vel lectus. In vel justo vel velit fringilla porttitor. Nullam sagittis. Suspendisse blandit nibh nec mauris. Praesent nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus bibendum leo quis neque. Vivamus consectetuer ligula at dui. Mauris iaculis sollicitudin nunc.
To prevent this, use {{clr}} to clear both sides, {{clrr}} to clear the right, or {{clrl}} to clear the left. This will place all following text (include more tables) after any floated elements:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur velit pede, imperdiet id, pellentesque ut, aliquam sed, nunc. Duis condimentum bibendum felis. Aliquam sed leo. Nunc volutpat volutpat massa. Curabitur luctus mauris eget urna. Donec dictum. Fusce a turpis. Nullam sodales fringilla neque. Aenean nibh. Donec viverra purus et est. Integer at enim molestie nulla fringilla imperdiet. Nam dictum rutrum eros. Sed ut diam. Etiam et elit. Praesent ut tellus. Nullam vel sem.
Multiplication table × 1 2 3 1 1 2 3 2 2 4 6 3 3 6 9 4 4 8 12 5 5 10 15 {{clrr}}
Sed luctus arcu nec nulla. Sed dictum rhoncus leo. Praesent fringilla, nunc ut hendrerit tempus, nibh sem venenatis sapien, vitae tempor lorem turpis eu justo. Vestibulum a nibh. Sed interdum. Suspendisse potenti. Fusce a nibh. Aenean sed urna nec tellus porta hendrerit. Vestibulum felis velit, scelerisque non, pellentesque sed, ultricies vitae, nulla. Etiam vel ligula. In hac habitasse platea dictumst. Aliquam id ante vitae nulla dictum laoreet. Aliquam erat volutpat.
Pellentesque felis. Nullam nec dui. Sed odio. Curabitur bibendum elementum metus. Donec luctus velit vel lectus. In vel justo vel velit fringilla porttitor. Nullam sagittis. Suspendisse blandit nibh nec mauris. Praesent nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus bibendum leo quis neque. Vivamus consectetuer ligula at dui. Mauris iaculis sollicitudin nunc.
[top]Decimal point alignment
A method to get columns of numbers aligned at the decimal point is as follows:
In simple cases one can dispense with the table feature and simply start the lines with a space, and put spaces to position the numbers:
432.1
43.21
4.321
class="bbcode_container" |
givesCode:
<blockquote>
{| cellpadding=0 cellspacing=0
|align=right| 432 || . || 1
|-
|align=right| 43 || . || 21
|-
|align=right| 4 || . || 321
|}
</blockquote>
432 . 1 43 . 21 4 . 321
In simple cases one can dispense with the table feature and simply start the lines with a space, and put spaces to position the numbers:
432.1
43.21
4.321
[top]External links
- area23.brightbyte.de - converts comma-separated values (CSV) format to pipe syntax
- HTML tables to wiki converter at wackyboy.com
- HTML tables to wiki converter at uni-bonn.de
- HTML tables to wiki converter at diberri.dyndns.org
- pywikipediabot (can convert HTML tables to wiki)
Contributors: | ,
Created by Last edited by , 10-23-2011 at 02:35 PM 0 Comments, 5,935 Views |
, 07-04-2007 at 02:06 AM
Tags for this Page
Similar Pages
-
Monster Table
By Arjan in forum TemplateComments: 0Last Post: 05-17-2007, 10:27 AM -
Creature Table/Data
By Arjan in forum TemplateComments: 0Last Post: 05-15-2007, 11:50 AM -
Creature Table
By Arjan in forum TemplateComments: 0Last Post: 05-15-2007, 11:09 AM -
Domain/Table
By Arjan in forum MainComments: 0Last Post: 04-09-2007, 09:43 PM
Bookmarks