Help:Table
You are encouraged to use House Style as below.
Tables can be converted from HTML to wiki format by the help of list of HTML to wiki table converters although HTML syntax also should work.
Generally you should keep the data in each cell of a table concise, However if you want to display a lot of data in say a column of cells, while other columns contain concise date consider using the special Table templates. These allow you to have cells with scroll bars and present the data in less space.
Contents |
The Wikicode Pipe syntax
- The table begins with a line "{| optional table parameters " and ends with the line "|}".
- Optional is a table caption included by the end of line "|+ caption " after "{|".
- A table row consists of the line "|- optional table parameters ", followed ona a new line, the codes for the cells of the row, separated by newline or "|"
- Table data are the codes for the cells; cell code is of the form "| value " or "| cell parameters | value "
- the row of column headings is identified by using "!" instead of "|", except for the separator between a cell parameter and a value; the difference with a normal row is browser (and default CSS style sheet) dependent but often rendered in a bold font.
- the first cell of a row is identified as row heading by starting the line with "!" instead of "|", and starting subsequent data cells on a new line.
The table parameters and cell parameters are the same as in HTML. However, the thead, tbody, tfoot, colgroup, and col elements are currently not supported. More examples of table manipulation are given in discussion.
eg:
{| class="wikitable"
|+ Example Table
|-----
!style="background:#669966; color:#ffffff;" | House Style 1
!style="background:#6699cc; color:#ffffff;" width="150px"| House Style 2
!style="background:#669966; color:#ffffff;" | House Style 1
|-----
!style="background:#effeef;" align="left" | Light House Style row
|style="background:#f9f9ff;" align="center" |R1C2
|style="background:#effeef;" align="center" |R1C3
|-----
!style="background:#dff9d9;" align="left" | Dark House Style row
|style="background:#e9f9f9;" align="center" |R2C2
|style="background:#dff9d9;" align="center" |R2C3
|-----
!style="background:#effeef;" align="left" | Light House Style row
|style="background:#f9f9ff;" align="center" |R3C2
|style="background:#effeef;" align="center" |R3C3
|-----
!style="background:#dff9d9;" align="left" | Dark House Style row
|style="background:#e9f9f9;" align="center" |R4C2
|style="background:#dff9d9;" align="center" |R4C3
|-----
|}
gives
House Style 1 | House Style 2 | House Style 1 |
---|---|---|
Light House Style row | R1C2 | R1C3 |
Dark House Style row | R2C2 | R2C3 |
Light House Style row | R3C2 | R3C3 |
Dark House Style row | R4C2 | R4C3 |
Sortable tables
Tables can be made sortable with class="sortable"
. Sortable tables are identified by the arrows in each of its header cells. Clicking them will cause the table rows to sort based on the selected column, in ascending order first, and subsequently toggling between ascending and descending order. Links and other wiki-markup are not possible in headers. Sorting is only possible for users who have javascript enabled.
e.g.
{| class="wikitable sortable"
|+ Example Table
|-----
!style="background:#669966; color:#ffffff;" | House Style 1
!style="background:#6699cc; color:#ffffff;" width="150px"| House Style 2
!style="background:#669966; color:#ffffff;" | House Style 1
|-----
!style="background:#effeef;" align="left" | Light House Style row
|style="background:#f9f9ff;" align="center" |R1C2
|style="background:#effeef;" align="center" |R1C3
|-----
!style="background:#dff9d9;" align="left" | Dark House Style row
|style="background:#e9f9f9;" align="center" |R2C2
|style="background:#dff9d9;" align="center" |R2C3
|-----
!style="background:#effeef;" align="left" | Light House Style row
|style="background:#f9f9ff;" align="center" |R3C2
|style="background:#effeef;" align="center" |R3C3
|-----
!style="background:#dff9d9;" align="left" | Dark House Style row
|style="background:#e9f9f9;" align="center" |R4C2
|style="background:#dff9d9;" align="center" |R4C3
|-----
|}
gives
House Style 1 | House Style 2 | House Style 1 |
---|---|---|
Light House Style row | R1C2 | R1C3 |
Dark House Style row | R2C2 | R2C3 |
Light House Style row | R3C2 | R3C3 |
Dark House Style row | R4C2 | R4C3 |