print

How do I insert a table?

From CopperWiki

Jump to: navigation, search

Some articles need to carry tables; the command for this is the extreme right button Image:Button_insert_table.pngin the Editing Tool Bar. Place cursor in text where you want the table and click on this button; a self-explanatory list of commands shows up, fill up the headers, rows and columns according to information that needs to be given, and then click on "Save page".


Step 1. If you click on the insert table button, by default, it will show the following text:

{| class="wikitable"

|-

! header 1

! header 2

! header 3

|-

| row 1, cell 1

| row 1, cell 2

| row 1, cell 3

|-

| row 2, cell 1

| row 2, cell 2

| row 2, cell 3

|}



  • The entire table is encased with curly brackets and a vertical bar character (a pipe). So use {| to begin a table, and |} to end it. Each one needs to be on its own line:


  • An optional table caption is included with a line starting with a vertical bar and plus sign "|+" and the caption after it:
{|
|+ caption
  table code goes here
|}
  • To start a new table row, type a vertical bar and a hyphen on its own line: "|-". The codes for the cells in that row will start on the next line.
{|
|+ The table's caption
|-
  cell code goes here
|-
  cell code goes here
|}
  • Type the codes for each table cell in the next row, starting with a bar:
{|
|+ The table's caption
|-
| cell codes go here
|-
| cells in the next row go here
| more cells in the same row here
|}
  • Cells can be separated with either a new line and new bar, or by a double bar "||" on the same line. Both produce the same output:
{|
|+ The table's caption
|-
|Cell 1 || Cell 2 || Cell 3
|-
|Cell A 
|Cell B
|Cell C
|}
  • If you use single bars, then what might appear to be the first cell is in fact a format modifier applied to the cell, and the rest of your "cells" will be merged into one:
{| border="1"
|-
|format modifier (not displayed)|These all |(including the pipes)|go into |the first cell
|-
|}

which is probably not what you want:

These all |(including the pipes)|go into |the first cell

However, the format modifier is useful:

{| border="1"
|-
|Cell 1 (no modifier - not aligned)
|-
|align="right" |Cell 2 (right aligned)
|-
|}
Cell 1 (no modifier - not aligned)
Cell 2 (right aligned)

Just remember: no more than 2 single pipes on a line!

Contributors