Special Templates / Table

Sub-page of SpecialTemplates

The table template special:table allows you to construct an HTML table within the wiki syntax.

Parameters

The template understands the following named parameters:

caption
add a caption to the table. The caption appears just below the table
border
add a border to the table. The value is any number, usually "1". The default is no border.
width
set the width of the table in percent of the space available. If not set, then the table width is determined by the browser
cellpadding
add some padding to the cells. Works just like the HTML attribute.
cellspacing
add some space between the cells. Works just like the HTML attribute.

Any anonymous parameter is treated like a table cell or table row:

row
A table row is indicated using a '-'.
heading
A table heading (HTML TH element) is indicated by starting the parameter with '= ' (space after equal sign!)
cell
A cell (HTML TD element) is any other parameter

Within a cell or heading you can add several (HTML-style) attributes. Attributes have to be prefixed with '!'. They behave just like the HTML attributes and can appear anywhere in the cell, although it is suggested to place them at the start or the end of the cell content.

border
possible values: red, green, blue.
colspan
possible values: any number.
rowspan
possible values: any number.
align
possible values: left, right, center.
valign
possible values: top, bottom, middle.

Caveats

Because of the way template parameters work you cannot have a cell value of "word=some text", as this would be interpreted as named parameter.

You can have almost anything within a cell (i.e. the usual wiki markup). E.g. it is possible to have diagrams or images there, make wiki links etc. However, GoWiki does not check, if the structure produced is valid HTML. So please refrain from creating pathological, twisted cases. Especially, do not misuse tables for page layout!

Be careful when inserting diagrams into a table. The vertical edge markers '|' are parameter separators within a template. Thus you should use '-' or '+' (the other edge markers) instead. Also, make sure that diagrams start on their own new line, otherwise the wiki engine does not pick up the start of the diagram correctly.

Examples

See also: Table design

[ext] PSPad or any similar program allowing aligning, editing in columns etc. may be helpful in editing larger tables.

{{special:table | caption=Game results | border=1
|= Players !colspan=2 |= Result
|-
| Me | You | B+20.5
|-
| Him | Her | W+10.2
|-
| You | Him |!border=red B+Resign
|-
| Team play !colspan=2 | no result
}}

results in

Game results
Players Result
Me You B+20.5
Him Her W+10.2
You Him B+Resign
Team play no result
{{special:table | caption=Diagram within a table
| Diagrams should start on a new line!
$$ Diagram using alternative edge markers
$$ . X . -
$$ O . O -
$$ . X . -
$$ ------+
| next cell content
}}

results in

Diagram within a table
Diagrams should start on a new line!
[Diagram]
Diagram using alternative edge markers  
next cell content

Special Templates / Table last edited by OscarBear on July 28, 2016 - 09:14
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
RecentChanges
StartingPoints
About
RandomPage
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Goproblems.com
Login / Prefs
Tools
Sensei's Library