Template:Table colspan
Jump to navigation
Jump to search
{{table colspan|columns|cell-text|align=|style=}}
Parameters
- columns (unnamed parameter 1)
- The number of columns to span. To span the entire row, set this to the total number of columns in the table.
- cell-text (unnamed parameter 2)
- The text to display in the cell
- align
- Optional. This sets the alignment for the cell, and functions the same as normal cell
align=[alignment].
Allowed values are"left","center","right". (The quotation marks are necessary.) - style
- Optional. This sets the style for the cell, and functions the same as normal cell
style=[specification].
This also requires quotation marks.
This template creates a new row, then creates a cell that spans the specified number of columns. This is intended for use with other table-row templates for visual clarity.
Because this creates a new row, it cannot be used to apply a colspan to cells that do not begin in the first column.
Examples
{|class="wikitable"
! Column 1 !! Column 2 !! Column 3 !! Column 4
|-
| A || B || C || D
{{table colspan|4|This spans the whole row}}
{{table colspan|2|This spans 2 columns}}|| G || H
{{table colspan|4|This spans the whole row & centers text|align="center"}}
{{table colspan|4|This spans the whole row & right-aligns text|align="right"}}
{{table footer}}
| Column 1 | Column 2 | Column 3 | Column 4 |
|---|---|---|---|
| A | B | C | D |
| This spans the whole row | |||
| This spans 2 columns | G | H | |
| This spans the whole row & centers text | |||
| This spans the whole row & right-aligns text | |||