Page data
Authors Lonny Grafman
Kathy Nativi
Chris Watkins
Published 2007
License CC BY-SA 4.0
Derivatives Ayuda:Tablas
Page views 2,529

How to insert a table[edit | edit source]

Edit source[edit | 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.

EditToolbar2.png

This is the initial text (code) by default:

code result
{| 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
|}
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

Visual editor[edit | edit source]

Editing existing tables[edit | edit source]

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

TablesVisualEditor.png

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

TablesVisualEditor2.png

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

TablesVisualEditor3.png

Adding tables[edit | edit source]

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

TablesVisualEditor4.png

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).

TablesVisualEditor5.png

Converting a spreadsheet to a wiki table[edit | edit source]

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

Format options[edit | edit source]

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"
!Header column 1
!Header column 2
|-
|cell 1
|cell 2
|}

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

Header column 1 Header column 2
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[edit | edit source]

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[edit | edit source]

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

See https://meta.wikimedia.org/wiki/Help:Table#Sorting for more information.

Collapsing tables[edit | edit source]

See Wikipedia:Help:Collapsing for help with collapsing.

Examples[edit | edit source]

See Help:Table examples

See also[edit | edit source]