Tips\tables
From WolfWikis
The wiki software makes it possible to create tables, although creating nice ones requires a bit of skill from the user. Often the easiest way to create a new table is to find a similar one e.g on wikipedia, copy it and start adapting it to your needs. To do that succesfully only a bit of basic knowledge is required.
Contents |
Purpose
To present information in an ordered, attractive and legible format
Pipe symbols
Although wiki allows the use of tags like <table> <tr> <td> the use of these to create tables is discouraged by most wiki's. Instead the use of pipe | symbols is recommended.
- A table is bracketed by putting the symbols {| and |} in the first column of the edit page (cf. tips\typing)
- A new line is given by |- in the first column of the edit page
- To start a new table column, use a pipe in the first column or two of them on the rest of the line
Table layout
The following code
{|
|-
|col1 ||col2||col3
|-
|something||something else||and else
|}
will be rendered as:
| col1 | col2 | col3 |
| something | something else | and else |
Obviously, a lot could be improved in the layout of this table
We could add a header by using bangs (!) instead of pipes
{|
!header1!!header2!!header3
|-
|col1 ||col2||col3
|-
|something||something else||and else
|}
is rendered as:
| header1 | header2 | header3 |
|---|---|---|
| col1 | col2 | col3 |
| something | something else | and else |
If you want to get fancy you need to add more odds and sods, e.g.
{|style="float:right; margin-left:0.5em; margin-bottom:0.5em; border: 1px solid #AAAAAA; border-collapse:collapse; text-align:center;" cellpadding="3" rules="all"
!bgcolor="#FFFFE0" |header1!!bgcolor="#BBFFE0" |header2!!bgcolor="#99FFE0" |header3
|-
|col1 ||col2||col3
|-
|something||something else||and else
|}
| header1 | header2 | header3 |
|---|---|---|
| col1 | col2 | col3 |
| something | something else | and else |
As you might guess the "foat:right puts the table on the right hand side and makes text wrap around it. The colors are defined by strings like "#FFFFE0" these are hexadecimal indications for red green and blue. So FFFFFF is white 000000 is black, FF0000 is pure red, 00FF00 is pure green and 0000FF is pure blue.
Combining templates and tables
We can put tables into templates and templates into tables and things will get complicated pretty rapidly. It certainly has an advantage to put all the layout information of a table in a template and then keep using the same table by using the template, rather composing a new table each time it is needed. A good example of prefabricated templated tables are the templates '(', '-' and ')'. They can be used to rapidly put separate entries (in a list e.g.) into a number of columns side by side:
{{(}}
*John
*Pete
*Charles
{{-}}
*Mike
*Paul
*Ahmed
{{-}}
*Nomsa
*Mbulelo
*Theodore
{{)}}
renders
|
|
|
More?
See tables on meta