Help:Creating tables

From Settlement AtWork Wiki
Jump to: navigation, search
This template: View, Discuss, Edit
SettlementAtWork wiki Help

<inputbox> type=search width=25 namespaces=Help**,SettlementAtWork,Main searchbuttonlabel=Search help pages </inputbox>


All Help pages

Tables

Don't want to create your own table? You can use this table template code instead. All you have to do is copy the code and insert your own content. Easy!

Tables can be very effective in the wiki. With a table you can arrange information.

To create a basic table:

  • Start with {|. This means you are creating a new table.
  • Put border="1" beside the {| start tag to give your table a border.
  • Use | to create a new column. Put your text under it like this:

|

\\Your text here\\

  • To create a new row use |-
  • To end your table use |}

More table information below ...

For example this:

Tablecode.png

Will make this:

123...

456...

678...

9..10..


Tables

There are three methods available to create tables: XHTML, HTML, and “pipe” syntax.

If you are familiar with XHTML or HTML syntax for creating tables and would like to use it, then go ahead. Here, only the “pipe” syntax will be explained because it is easy to learn and also easy to read in edit mode.

To learn pipe syntax for tables, it is easiest to first look at an example. If you typed the following in edit mode:

{|
| cell1 || cell2
|- 
| cell3 || cell4
|-
| cell5 || cell6
|}

You would see on the article page:

cell1 cell2
cell3 cell4
cell5 cell6

Formatting the Table

Table Level The table should be started on a new line with {| param and end with |}. In place of "param" you have the option of entering parameters that affect the look of the table, which are listed below.

Name Function Values
align horizontal text alignment left, right, center
border border thickness number
width width number
cellpadding internal cell spacing number
cellspacing external cell spacing number

Row Level The first row is automatically created with the {| at the beginning of the table and subsequent rows are created with |- param. The optional parameters at the row level are in the table below.

Name Function
align horizontal text alignment
valign vertical alignment

Cell Level There are two options for creating cells. By either two pipes next to each other: | param || cell1 || param | cell2 || param | cell3

Or by using one pipe symbol on a new line:
| param | cell1
| param | cell2
| param | cell3

There are optional parameters at the cell level which are in the table below:

Name Function
align horizontal text alignment
colspan several adjacent cells in a column are merged
rowspan several adjacent cells in a row are merged
topleft topmiddle topright
midleft midmiddle midright
bottomleft bottommiddle bottomright
topleft topmiddle topright
midleft midmiddle midright
bottomleft bottommiddle bottomright

Other Tips To make column headings in bold, you have the option of using exclamation marks instead of the pipe symbol at the beginning of the row, and double exclamation marks between each cell instead of double pipe symbols.

Example: ! Name !! Function !! Values

External links