Jump to content

Technical writing/Tools/Making Wiki Tables

From Wikiversity

How to edit Wiki

Wikiversity Main Page

Why and When to use Tables

[edit | edit source]

Tables are an excellent way to organize large amounts of information in an easy to read way.

Table Syntax

[edit | edit source]

The following code will build a basic table.

Tables always begin with {| and end with |}


In the first line we set the widths of the borders and the space between cells.

{| border="1" cellpadding="1" cellspacing="1"

On the second line we enter the title of the table.

|+ 2006/07 Premier League Table



The following lines create the column headings, when creating the column headings we use a "!" instead of a pipe.


|-
!Position
!Club Name
!Points



Now we create the rows and the information that goes in them. Each line starts with a pipe and each row of information is separated by a |-.

|-
|1 || Manchester United || 89
|-
|2 || Chelsea || 83
|-
|3 || Liverpool || 68
|-
|4 || Arsenal || 68
|-
|5 || Tottenham || 60
|-
|6 || Bolton || 59

Notice that each cell is split by a double pipe ||. Usually there would be no space between the pipes, here the space is there to make reading the code easier.

This will create a basic table, which looks like this.

Tips and Tricks

[edit | edit source]

Table width:

In the first line of the table it is possible to define the table's width, for example:

{| width=1000pt border="1" cellpadding="1" cellspacing="1"

Column width:

To define the column width just add a percentage of the overall width to the column heading lines, as follows:

! width=25% | Position
! width=50% | Club Name
! width=25% | Points

The table now looks like this:


2006/07 Premier League Table
Position Club Name Points
1 Manchester United 89
2 Chelsea 83
3 Liverpool 68
4 Arsenal 68
5 Tottenham 60
6 Bolton 59

Common Problems

  • Missing pipes
  • Too many spaces
  • Not ending the table with |}


Exercise 1 Adding a Table to a Wiki

[edit | edit source]
  1. Create a page
  2. Add a table with 2 columns and five rows
  3. Fill in the table with the names of five people and their favorite drink
  4. Save your page
  5. Debug the table if needed

Examples

[edit | edit source]
List of subpages