Help:Tables

From CRFH
Jump to: navigation, search

To create tables in the wiki, there is a special syntax. Tables are enclosed between {| and |} tags. A basic example is as follows:

{| class="wikitable"
|-
! header 1
! header 2
! header 3
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
|}

which outputs the following table:

header 1 header 2 header 3
row 1, cell 1 row 1, cell 2 row 1, cell 3
row 2, cell 1 row 2, cell 2 row 2, cell 3

However, there is a lot more to the table syntax than just that. Read on if you're interested.

Basic Table Syntax

{| attributes
   table contents
|}

Create a table. Within the table there are various other codes available, as follows. All attributes of HTML tables are accepted.

|+ text

Include a caption above the table. This must appear first in the table code.

|- attributes
   row contents

Start a new row. Accepts any attributes of HTML table rows.

| cell contents

Start a new cell.

| cell contents || cell contents

Defining multiple cells on the same line.

| attributes | cell contents

Specify attributes for the cell. Any HTML table cell attributes are accepted.

| attributes | cell contents || attributes | cell contents

You can even put multiple cells with attributes on the same line.

! cell contents

Start a new header cell.

! cell contents !! cell contents

Defining multiple header cells on the same line.

! attributes | cell contents

Specify attributes for the header cell. Any HTML table header cell attributes are accepted.

! attributes | cell contents !! attributes | cell contents

You can even put multiple header cells with attributes on the same line.

Attributes

(stub)

Available Classes

You can specify a class as one of the attributes in the table markup. Currently, the only available class is "wikitable".

Personal tools