Difference between revisions of "Wiki Tables Howto"

From Calguns Foundation Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
== Wiki table markup summary ==
 +
{|cellpadding="5" cellspacing="0" border="1" width="60%"
 +
|
 +
<nowiki>{|</nowiki>
 +
| '''table start'''
 +
|-
 +
|
 +
<nowiki>|+</nowiki>
 +
| table '''caption,''' ''optional;'' only between '''table start''' and first '''table row'''
 +
|-
 +
|
 +
<nowiki>|-</nowiki>
 +
| '''table row,''' ''optional on first row'' -- wiki engine assumes the first row
 +
|-
 +
|
 +
<nowiki>!</nowiki>
 +
| '''table header''' cell, ''optional.'' Consecutive '''table header''' cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).
 +
|-
 +
|
 +
<nowiki>|</nowiki>
 +
| '''table data''' cell, ''required!'' Consecutive '''table data''' cells may be added on same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>).
 +
|-
 +
|
 +
<nowiki>|}</nowiki>
 +
| '''table end'''
 +
|}
 +
*The above marks must '''start on a new line''' except the double <code>||</code> and <code>!!</code> for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
 +
*'''XHTML attributes.''' Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
 +
**Cells and caption (<code>|</code> or <code>||</code>, <code>!</code> or <code>!!</code>, and <code>|+</code>) hold content. So separate any attributes from content with a single pipe (<code>|</code>). Cell content may follow on same line or on following lines.
 +
**Table and row marks (<code>{|</code> and <code>|-</code>) do not directly hold content. Do ''not'' add pipe (<code>|</code>) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it ''and'' your final attribute if it was touching the erroneous pipe!
 +
*'''Content''' may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
 +
**'''Pipe character as content.''' To insert a pipe (<code>|</code>) character into a table use the &lt;nowiki&gt;<code>|</code>&lt;/nowiki&gt; escaping markup
 +
 +
 
This is a quick explanation of how to build and maintain tables in wiki.
 
This is a quick explanation of how to build and maintain tables in wiki.
  
Line 5: Line 39:
 
  .  !colspan="8"|Index of Federal Courts    <-------- Span eight columns (colspan), and Title the columns "Index of Federal Courts"
 
  .  !colspan="8"|Index of Federal Courts    <-------- Span eight columns (colspan), and Title the columns "Index of Federal Courts"
 
  .  |-                                      <-------- This ends the row and tells the table to begin a new row
 
  .  |-                                      <-------- This ends the row and tells the table to begin a new row
  .  !Abbr.                                  <-------- The "!" makes a column title '''bold''' and centered
+
  .  !Abbr.                                  <-------- The "!" makes a table header '''bold''' and centered
  .  !Full Name                              <-------- The "!" makes a column title '''bold''' and centered     
+
  .  !Full Name                              <-------- The "!" makes a table header '''bold''' and centered     
  .  !Website                                <-------- The "!" makes a column title '''bold''' and centered
+
  .  !Website                                <-------- The "!" makes a table header '''bold''' and centered
  .  !Circuit                                <-------- The "!" makes a column title '''bold''' and centered
+
  .  !Circuit                                <-------- The "!" makes a table header'''bold''' and centered
  .  |- align="center"                        <-------- The align="centered" attributie will apply to ALL Cells in the ROW
+
  .  |- align="center"                        <-------- The align="centered" attribute will apply to ALL Cells in the ROW
 
  .  |CAED                                    <-------- DATA
 
  .  |CAED                                    <-------- DATA
 
  .  |                                        <-------- DATA
 
  .  |                                        <-------- DATA
Line 41: Line 75:
 
|bgcolor="red"|text
 
|bgcolor="red"|text
 
|}
 
|}
 
 
== Wiki table markup summary ==
 
{|cellpadding="5" cellspacing="0" border="1" width="60%"
 
|
 
<nowiki>{|</nowiki>
 
| '''table start'''
 
|-
 
|
 
<nowiki>|+</nowiki>
 
| table '''caption,''' ''optional;'' only between '''table start''' and first '''table row'''
 
|-
 
|
 
<nowiki>|-</nowiki>
 
| '''table row,''' ''optional on first row'' -- wiki engine assumes the first row
 
|-
 
|
 
<nowiki>!</nowiki>
 
| '''table header''' cell, ''optional.'' Consecutive '''table header''' cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).
 
|-
 
|
 
<nowiki>|</nowiki>
 
| '''table data''' cell, ''required!'' Consecutive '''table data''' cells may be added on same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>).
 
|-
 
|
 
<nowiki>|}</nowiki>
 
| '''table end'''
 
|}
 
*The above marks must '''start on a new line''' except the double <code>||</code> and <code>!!</code> for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
 
*'''XHTML attributes.''' Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
 
**Cells and caption (<code>|</code> or <code>||</code>, <code>!</code> or <code>!!</code>, and <code>|+</code>) hold content. So separate any attributes from content with a single pipe (<code>|</code>). Cell content may follow on same line or on following lines.
 
**Table and row marks (<code>{|</code> and <code>|-</code>) do not directly hold content. Do ''not'' add pipe (<code>|</code>) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it ''and'' your final attribute if it was touching the erroneous pipe!
 
*'''Content''' may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
 
**'''Pipe character as content.''' To insert a pipe (<code>|</code>) character into a table use the &lt;nowiki&gt;<code>|</code>&lt;/nowiki&gt; escaping markup
 

Revision as of 18:08, 3 December 2010

Wiki table markup summary

{|
table start
|+
table caption, optional; only between table start and first table row
|-
table row, optional on first row -- wiki engine assumes the first row
! 
table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).
|
table data cell, required! Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).
|}
table end
  • The above marks must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
  • XHTML attributes. Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
    • Cells and caption (| or ||, ! or !!, and |+) hold content. So separate any attributes from content with a single pipe (|). Cell content may follow on same line or on following lines.
    • Table and row marks ({| and |-) do not directly hold content. Do not add pipe (|) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it and your final attribute if it was touching the erroneous pipe!
  • Content may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
    • Pipe character as content. To insert a pipe (|) character into a table use the <nowiki>|</nowiki> escaping markup


This is a quick explanation of how to build and maintain tables in wiki.

== Index of Federal Courts ==
.  {| border="5"                            <-------- Begins table and sets attribute for the table border (for looks)
.  !colspan="8"|Index of Federal Courts     <-------- Span eight columns (colspan), and Title the columns "Index of Federal Courts"
.  |-                                       <-------- This ends the row and tells the table to begin a new row
.  !Abbr.                                   <-------- The "!" makes a table header bold and centered
.  !Full Name                               <-------- The "!" makes a table header bold and centered    
.  !Website                                 <-------- The "!" makes a table header bold and centered
.  !Circuit                                 <-------- The "!" makes a table headerbold and centered
.  |- align="center"                        <-------- The align="centered" attribute will apply to ALL Cells in the ROW
.  |CAED                                    <-------- DATA
.  |                                        <-------- DATA
.  |                                        <-------- DATA
.  |                                        <-------- DATA
.  |- align="center"                        <-------- Begin a new row, and Center all data in the row
.  |CASD                                    <-------- DATA
.  |                                        <-------- DATA
.  |                                        <-------- DATA
.  |bgcolor="red"|text                      <-- Make cell red and write "text" into cell. Notice the use of the  "|" (pipe) symbol
.  |}                                       <-------- Terminates the row and "}" ends the table.


Index of Federal Courts

Index of Federal Courts
Abbr. Full Name Website Circuit
CAED
CASD text