Memory Alpha
Advertisement
Memory Alpha
Help Contents → Table markup

This page is a basic guide for creating tables using wiki markup.

Table[]

The table itself is defined by:

{|class="grey"
|}

In addition to class="grey", you can add any attributes that are supported by HTML table tag, such as an id (id="your-id-here") or the table's width, specified in pixels or as a percentage of the screen width (width="1000px" or width="60%").

If you wish to include multiple classes or ids, add them within the appropriate attribute; for example, class="grey sortable". Make sure to separate each attribute declaration by a space, for example, class="grey" width="600px".

Caption[]

The caption is generated by:

|+Caption

The caption must go on its own line to be recognized by the wiki parser engine.

Row[]

A row of cells is started like this:

|-

The code must be on its own line, and serves the same purpose as the <tr> tag. You can add attributes after the -, for example, style="text-align:center;"

Header[]

A header cell is created like this:

!Heading

This takes the place of the <th> tag. If you want to assign parameters to your cell, for example, style="text-align:center;", they will go like this:

!style="text-align:center;"|Content

To create multiple header cells, you may either put each on a new line or leave them on the same line, separated from each other with pairs of exclamation marks (!!).

Cell[]

Normal table cells (<td>) are created like this:

|Content

These are similar to header cells, except they use the pipe character instead of an exclamation mark. Including multiple cells in one row works the same as with header cells, except that, again, pipes are used instead of exclamation marks. If you want to assign parameters to a cell, they go between two pipes:

|colspan="2" rowspan="3"|Content

Example[]

Here is an example of table syntax, using the various functions explained above:

{|class="grey sortable" style="margin:auto;"
|+Caption Here
|-
!Header A!!Header B!!Header C
|-
|Cell 1A||Cell 1B||Cell 1C
|-
|colspan="2" rowspan="2" style="text-align:center;"|Cell 2A–3B||Cell 2C
|-
|Cell 3C
|}

And here is the table in its processed form:

Caption Here
Header A Header B Header C
Cell 1A Cell 1B Cell 1C
Cell 2A–3B Cell 2C
Cell 3C

See also[]

Advertisement