Help?

Help:Tables Presentation

From Textpattern CMS User Documentation

Revision as of 15:38, 6 October 2008 by Destry (Talk | contribs)
(diff) ←Older revision | Latest revision (diff) | Newer revision→ (diff)

Of all the MediaWiki syntax, that for tables is probably the most difficult for people to manage, but there's two positive sides to this problem. First, there should be little to no need for tables in a wiki about CMS documentation. Thus, no tables, no table syntax. 2) You can use regular HTML markup in MediaWiki, so if you savvy HTML table markup, use it instead.

Whichever syntax you might use, tables are pre-styled so they always conform with the TextBook theme. In some cases additional classes must be used for the total presentational effect. Three examples are given below using MW syntax. You can substitute HTML, using the classes as you normally would.

Vertical Tables

A typical table having headers across the top. You only need the class for creating the zebra-stripes, namely class="odd".

Header 1 Header 2 Header 3
column 1 row 1 column 2 row 1 column 3 row 1
column 1 row 2 column 2 row 2 column 3 row 2
column 1 row 3 column 2 row 3 column 3 row 3
et cetera et cetera and so forth

Copy Syntax...

{|
|-
!Header 1
!Header 2
!Header 3
|- class="odd"
|column 1 row 1
|column 2 row 1
|column 3 row 1
|-
|column 1 row 2
|column 2 row 2
|column 3 row 2
|- class="odd"
|column 1 row 3
|column 2 row 3
|column 3 row 3
|-
|et cetera
|et cetera
|and so forth
|}

Horizontal Tables

A table where headers are aligned with rows, along the side. In this case, we use an additional class for zebra-striping the headers to, namely class="left-even" on the even rows.

Header 1 column 2 row 1
Header 2 column 2 row 2
Header 3 column 2 row 3

Copy syntax...

{|
|- class="odd"
! Header 1
| column 2 row 1
|- class="even"
! class="left-even"|Header 2
| column 2 row 2
|- class="odd"
! Header 3
| column 2 row 3
|}

Matrix Tables

You can combine the two table types above to create a true matrix table. Note in this case we need yet another class to remove the upper left cell's background. Zebra-striping the left column headers would be optional; if no stripes wanted, just drop class="left-even"| from the even rows.

Top Header 1 Top Header 2 Top Header 3
Left Header 1 column 2 row 1 column 3 row 1 column 4 row 1
Left Header 2 column 2 row 2 column 3 row 2 column 4 row 2
Left Header 3 column 2 row 3 column 3 row 3 column 4 row 3
Left Header 4 column 2 row 4 column 3 row 4 column 4 row 4

Copy syntax...

{|
|-
! class="white-cell"
!Top Header 1
!Top Header 2
!Top Header 3
|- class="odd"
! Left Header 1
| column 2 row 1
| column 3 row 1
| column 4 row 1
|-
! class="left-even"|Left Header 2
| column 2 row 2
| column 3 row 2
| column 4 row 2
|- class="odd"
! Left Header 3
| column 2 row 3
| column 3 row 3
| column 4 row 3
|-
! class="left-even"|Left Header 4
| column 2 row 4
| column 3 row 4
| column 4 row 4
|}
Translations [?]