## How to insert a table

### Edit source

The wikitext language has some marks provided to create tables. Row and column tables with text or data can be incorporated into the wiki.

To insert a table you can click the 'Table' button on the edit toolbar that appears when you click edit on a page.

This is the initial text (code) by default:

code result
{| class="wikitable"
|-
|row 1, cell 1
|row 1, cell 2
|row 1, cell 3
|-
|row 2, cell 1
|row 2, cell 2
|row 2, cell 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

### Visual editor

#### Editing existing tables

This is a guide on how to create or edit tables using the visual editor.

1) To edit an existing table, simply double click on a cell.

2) If you want to format a cell, just click once to select it. You also have the option to designate it as a 'Header cell' by clicking Content cell

3) You can also give any type of format to the text by clicking on the following:

4) To merge cells, simply select the ones you want to merge and the dialog box will appear. Click on Merge.

1) To add a table, go to the toolbar, click on Insert and then "Tables".

After selecting how many columns and rows you want, it will be inserted in the place you have chosen. Now you can proceed to add text.

2) If you want to insert, move, delete a column or row, you just have to select a cell, and an arrow will immediately appear at the top (for columns), or on the left side (for rows).

## Converting a spreadsheet to a wiki table

Excel2Wiki is a tool that helps you convert a Gnumeric, MS Excel, or OpenOffice.org Calc spreadsheet to a wiki table.

## Format options

For basic formatting, with lines and light shading, use: class="wikitable"

Style commands:

• To align the table and allow text to wrap, use "float:right" or "float:left"
• Headers: start these rows with exclamation marks (!)
• To make space between the table and surrounding text or objects, use margin, e.g margin:.5em; (inside the style="..." term)
• Spacing between border and contents: use cellpadding. For some reason it doesn't seem to work inside the style="..." term, so use it in this form: cellpadding="10"

Applying wikitable, float right and margin in a simple table looks like this:

{| class="wikitable" style="float:right; margin:.5em"
|-
|cell 1
|cell 2
|}


Which displays like this (note that the following text wraps around the table):

cell 1 cell 2

Dummy text... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris interdum augue ut dui lobortis vitae pellentesque sem ornare. Proin sodales lectus nec erat semper hendrerit. Aenean pulvinar quam eu purus vehicula euismod. Etiam et magna leo. Vivamus eu metus vel leo sodales sollicitudin. Curabitur porttitor rutrum quam ac gravida. In eget tristique nisi. Pellentesque nulla sapien, pulvinar ultricies egestas sit amet, porttitor non leo.

For more formatting options, see Help:Notices.

## Video demonstrations

How to insert a table (Visual Edit)

Tutorial on how to create a table (Visual edit) in Appropedia.

Language: English (EN)
Cómo insertar una tabla (Visual Edit)

Tutorial sobre cómo crear una tabla (Visual edit) en Appropedia.

Language: Español (ES)

## Sortable table

Sortable tables can be created by using class="wikitable sortable". As shown in the following example:

{| class="wikitable sortable"
!Run #
!Temperature (°F)
!Humidity (%)
|-
|1
|78
|42
|-
|2
|76
|55
|-
|3
|74
|41
|}

that creates (notice the sort buttons next to the headings)
 Run # Temperature (°F) Humidity (%) 1 78 42 2 76 55 3 74 41