Template:Ctr/doc
Jump to navigation
Jump to search
The ctr template is used align text and numbers within tables to the center of the cell.
Examples
{| class="wikitable"
|-
| {{ctr}} | N/A
| {{ctr}} | Example of centred text.
|-
| {{ctr}} | Some centred text.
| {{ctr}} | etc.
|}
yields:
| N/A | Example of centred text. |
| Some centred text. | etc. |
{| class="wikitable"
|-
| {{ctr}} | N/A || {{ctr}} | Example of centred text.
|-
| {{ctr}} | Some centred text. || {{ctr}} | etc.
|}
yields:
| N/A | Example of centred text. |
| Some centred text. | etc. |
Combining with colspan
To combine with colspan, place {{ctr}} first, followed by a space, then by colspan.
Example:
{| class="wikitable"
|-
| {{ctr}} colspan=3 | Text over 3 columns
|-
| {{ctr}} | Column #1
| {{ctr}} | Column #2
| {{ctr}} | Column #3
|-
| {{ctr}} | A single column
| {{ctr}} colspan=2 | Text over two columns
|}
will yield:
| Text over 3 columns | ||
| Column #1 | Column #2 | Column #3 |
| A single column | Text over two columns | |
Remember, most browsers will render a header row as centered:
{| class="wikitable"
! Header row
! Another header row
|-
| Standard row
| Another standard row
|}
gives:
| Header row | Another header row |
|---|---|
| Standard row | Another standard row |