Creating Tables

From OpenOptogenetics.org

Jump to: navigation, search

OpenOptogenetics.org uses the table format a lot. See for example the GECI page which has a large table listing all available genetically-encoded calcium probes. Mediawiki (the engine powering OpenOptogenetics.org and a ton of other wikis including Wikipedia) has a specific syntax for tables (see MediaWiki's help page on tables).

Create tables from xls spreadsheet

A simple way to create tables in MediaWiki from spreadsheets consists in using a xls to wiki copy/paste converter such as http://excel2wiki.net/. This website will give you the wiki markup corresponding to a given selection of cells.

Beware: the resulting table will not have the header used in OpenOptogenetics. Make sure you insert the right header in your wiki markup.

Simple table example

Tables in OpenOptogenetics are built using the following markup example:

{| border="1" cellpadding="4" cellspacing="0" style="width:50%;margin: 1em 1em 1em 0; background: #f9f9f9;
border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;"
|-
!scope="col" | Column 1
!scope="col" | Column 2
!scope="col" | Column 3
|-
| Column 1/cell 1
| Column 2/cell 1
| Column 3/cell 1
|-
| Column 1/cell 2
| Column 2/cell 2
| Column 3/cell 2
|-
| Column 1/cell 3
| Column 2/cell 3
| Column 3/cell 3
|-
|}

... which looks like this:

Column 1 Column 2 Column 3
Column 1/cell 1 Column 2/cell 1 Column 3/cell 1
Column 1/cell 2 Column 2/cell 2 Column 3/cell 2
Column 1/cell 3 Column 2/cell 3 Column 3/cell 3

Table with cells spanning several columns or rows

To create cells spanning several rows, check the following example markup:

{| border="1" cellpadding="4" cellspacing="0" style="width:50%;margin: 1em 1em 1em 0; background: #f9f9f9;
border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;"
|-
!scope="col" | Column 1
!scope="col" | Column 2
!scope="col" | Column 3
|-
| rowspan="2"| cell spanning 2 rows 
| Column 2/cell 1
|-
| Column 1/cell 2
| Column 2/cell 2
| Column 3/cell 2
|-
| Column 1/cell 3
| Column 2/cell 3
| Column 3/cell 3
|-
|}

which gives this:

Column 1 Column 2 Column 3
Cell spanning 2 rows Column 2/cell 1 Column 3/cell 1
Column 2/cell 2 Column 3/cell 2
Column 1/cell 3 Column 2/cell 3 Column 3/cell 3

To create a table with cells spanning several columns, use the following example markup:

{| border="1" cellpadding="4" cellspacing="0" style="width:50%;margin: 1em 1em 1em 0; background: #f9f9f9;
border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;"
|-
!scope="col" | Column 1
!scope="col" | Column 2
!scope="col" | Column 3
|-
| colspan="2"| Cell spanning 2 columns
| Column 3/cell 1
|-
| Column 1/cell 2
| Column 2/cell 2
| Column 3/cell 2
|-
| Column 1/cell 3
| Column 2/cell 3
| Column 3/cell 3
|-
|}

which gives:

Column 1 Column 2 Column 3
Cell spanning 2 columns Column 3/cell 1
Column 1/cell 2 Column 2/cell 2 Column 3/cell 2
Column 1/cell 3 Column 2/cell 3 Column 3/cell 3