Template:Vertical header/doc
This is a documentation subpage for Template:Vertical header. It contains usage information, categories, and other content that is not part of the original template page. |
Uses Lua: |
This template simplifies the creation of table cells (typically headers, including those in sortable tables) with vertically-oriented contents. Although this template was created to produce table header cell specifically, there is nothing to impede its use for standard table cells as well, if desired.
Usage
[edit]This template must be called within already defined wikitext table syntax (after
but before {|
), and after a cell delimiter character (either |}
oder |
). If a cell has other attributes, for example !
, class=
oder colspan=
, there must be no vertical bar (rowspan=
|
) between them and the template call. Any CSS style properties desired must be supplied as the value of the |cellstyle=
parameter, including the terminating semicolon (
) for each.
;
Parameters
[edit]0 | 1 | 2 |
3 | 8 | 13 |
|text
oder|1=text
– The cell's contents (shown here as text), which can contain wikilinks. You can escape the equality sign either by using{{=}}
when the parameter is unnamed (a/k/a positional, as|text
), or by explicitly supplying it as the value for the|1=
parameter.|unbold=
– When any non-empty value is assigned, header cells will have their default bold appearance removed.|align=
– Controls the vertical alignment of the cell's contents, with valid values of:
(default),bottom
andtop
).middle
|sortable=
– Applies extra padding to the cell when assigned any non-empty value, accounting for the arrows shown on sortable table column headers and footers (most useful when headers are bottom-aligned, and required for sortable columns).|width=
– Overrides cell width, which is otherwise automatically generated based on the number of line breaks present in the cell's contents (
,<BR>
or any other form of valid HTML line breaks are correctly parsed).<br />
|style=
– Additional CSS style properties for the<div>...</div>
tags containing the rotated text (may contain quotation marks
)."
|cellstyle=
– Additional CSS style properties for the entire cell (may contain quotation marks
). Use this instead of the cell's"
attribute, which is wholly generated by this template. Use the CSS3style=
property instead ofbackground-color:
oderbackground
, if you wish to override the default cell color.bgcolor
Examples
[edit]- ! {{Vertical header|Your text here}} – Basic example
- ! {{Vertical header|unbold=yes|sortable=yes|Your text here}} – Produces an explicitly sortable, unbolded header
- ! {{Vertical header|align=top|Your text here}} – Produces an unsortable, top-aligned table header
- ! colspan="2" {{Vertical header|cellstyle=background-color: Gold;|Your text here}} – Produces an unsortable header spanning two columns with a gold background (note there is no vertical bar after
).colspan="2"
The example below demonstrates headers that span rows and columns (using
and rowspan=
).
colspan=
Wikitext | Parsed output | ||||||||||||
{| class="wikitable sortable"
|-
! rowspan="2" {{Vertical header|sortable=yes|Name}}
! colspan="2" {{Vertical header|Data columns}}
! rowspan="2" {{Vertical header|sortable=yes|Another column}}
|-
! {{Vertical header|sortable=yes|Data}}
! {{Vertical header|sortable=yes|More data}}
|-
! Cats
| 273
| 53
| 1
|-
! Dogs
| 65
| 8,492
| 2
|-
! Varmints
| 1,649
| 548
| 3
|}
|
|
Notes
[edit]- In Internet Explorer versions 5–10, the baseline of the contents is on the opposite side (text flows from top to bottom with the baseline on the left).
- Firefox support for vertical text and rotation began in version 25 (released October 2013), but it was unstable until version 41 (released September 2015), and incomplete until version 43 (released December 2015).
TemplateData
[edit]Vertical header
Creates of wikitable cells (typically headers, including those in sortable tables) with vertically-oriented contents
Parameter | Description | Typ | Status | |
---|---|---|---|---|
Cell contents | 1 | The text to appear vertically inside the cell
| String | required |
Sortable table header | sortable | Creates a cell with the necessary properties and spacing for a header (or footer) in a table with 'class=sortable', otherwise do not define
| Line | optional |
Alignment | align | Set the alignment of the cell's contents, defaults to 'bottom' (appropriate for table headers) but other valid values are 'middle' (appropriate for normal table cells) and 'top' (appropriate for footers)
| Line | optional |
Cell height | width | Sets an explicit maximum for the cell's height (would be called its width in a normal, horizontally displayed cell) in any valid CSS3 length unit (such as px, em, %, vw, vh, etc.)
| Line | optional |
Text weight | unbold | Overrides the default boldness applied to table headers and footers when set to an non-empty value, otherwise leave undefined
| Line | optional |
Text style | style | Allows additional CSS3 style properties to be defined for the <div> tags which enclose the cell's contents, leaving the cell itself undisturbed, must include the terminating semicolon for each
| Line | optional |
Cell style | cellstyle | Allows additional CSS3 properties to be defined for the cell itself, also affecting the contents; must include the terminating semicolon for each
| Line | optional |