Difference between revisions of "Table markup"

From Sega Retro

m (2 revisions)
(Redirected page to cdn:Help:Table markup)
 
Line 1: Line 1:
'''← [[Help: Contents]]'''
+
#REDIRECT [[cdn:Help:Table markup]]
 
 
This page is a basic guide for creating tables using wiki markup.
 
 
 
==Table==
 
The table itself is defined by:
 
 
 
  <nowiki>{|</nowiki> ''params''
 
  <nowiki>|}</nowiki>
 
 
 
Instead of ''params'', you can put any parameters you choose that would normally go into a HTML table. Common examples used in many of the wiki's table tables is <tt>align="center"</tt> or <tt>border="1"</tt>.
 
 
 
: '''Careful:''' You must include the space between <nowiki>{|</nowiki> and params, or the first parameter gets ignored.
 
 
 
==Caption==
 
The caption is generated by:
 
 
 
  <nowiki>|+ content</nowiki>
 
 
 
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:
 
 
 
  <nowiki>|- </nowiki>
 
 
 
The code must be on its own line, and serves the same purpose as the TR tags.
 
 
 
==Header==
 
A header cell is created like this:
 
 
 
  <nowiki>! content</nowiki>
 
 
 
Each cell must go on its own line.  This takes the place of the TH tag.  If you want to assign parameters to your cell, they will go like this:
 
 
 
  <nowiki>!</nowiki> ''params'' | content
 
 
 
Make sure to have a space between the pipe and the parameters!
 
 
 
==Cell==
 
Normal table cells (TD) are created like this:
 
 
 
  <nowiki>| content</nowiki>
 
 
 
These are similar to header cells, except they use the pipe character instead of an exclamation point.  Again, each cell must go on its own line.  If you want to assign parameters to a cell, they go between two pipes:
 
 
 
  <nowiki>|</nowiki> ''params'' | content
 
 
 
==Example==
 
The following example combines all of the previous examples:
 
<pre>
 
<nowiki>
 
      {| align="center" border="1"
 
      |+ Caption Here
 
      |-
 
      ! Header 1
 
      ! Header 2
 
      ! Header 3
 
      |-
 
      | Row 1, Col 1
 
      | Row 1, Col 2
 
      | Row 1, Col 3
 
      |-
 
      | Row 2, Col 1
 
      | Row 2, Col 2
 
      | Row 2, Col 3
 
      |-
 
      | colspan="2" | Row 3, Cols 1-2
 
      | Row 3, Col 3
 
      |}
 
</nowiki>
 
</pre>
 
And here is the table in its processed form:
 
 
 
{| align="center" border="1"
 
|+ Caption Here
 
|-
 
! Header 1
 
! Header 2
 
! Header 3
 
|-
 
| Row 1, Col 1
 
| Row 1, Col 2
 
| Row 1, Col 3
 
|-
 
| Row 2, Col 1
 
| Row 2, Col 2
 
| Row 2, Col 3
 
|-
 
| colspan="2" | Row 3, Cols 1-2
 
| Row 3, Col 3
 
|}
 
 
 
[[Category:Help|Table markup]]
 

Latest revision as of 09:13, 10 March 2018