Template:Vertical header/sandbox
![]() | This is the template sandbox page for Template:Vertical header (diff). See also the companion subpage for test cases. |
![]() | This template uses Lua: |
Regular column
|
Vertical value column
|
Thin gold column
|
Unsortable column
|
---|---|---|---|
0 | 1 |
1 | 2 |
3 | 5 |
8 | 13 |
Regular column
|
Vertical value column
|
Thin gold column
|
Unsortable column
|
This is a template that helps create vertically oriented column headers in tables. It even works for sortable columns.
Although this template was made with table headers in mind, it can work with regular cells as well.
If the header cells have other attributes, for example, colspan
oder rowspan
, there must be no vertical bar |
between the attributes and the template call.
If your browser does not support CSS property writing-mode: vertical-rl
that makes this template possible, it gracefully degrades to the default display of the table columns.
The |1=
text can contain wikilinks ([[]]
). You can escape the equals sign either by using {{=}}
or by explicitly mentioning the |1=
parameter. Styles may contain double quotes.
Examples
[edit]! {{vert header|Your text here}}
– basic example! {{vert header|nb=1|Your text here}}
– produces a no-bold, sortable header! {{vert header|class=unsortable|va=top|Your text here}}
– produces an unsortable, top-aligned table header! colspan="2" {{vert header|cellstyle=background-color:gold|Your text here}}
– produces a header spanning two columns, with a gold background; use no vertical bar aftercolspan
You can also use the ! {{verth|Your text here}}
shorthand.
An example below (from Help:Sortable tables) with headers that span rows or columns (using rowspan and colspan). Note that there is no vertical bar |
between rowspan=2
and {{vert header...}}
|
{| class="wikitable sortable"
|-
! rowspan=2 {{vert header|name}}
! colspan=2 {{vert header|class=unsortable|data columns}}
! rowspan=2 {{vert header|another column}}
|-
! {{vert header|data}}
! {{vert header|more data}}
|-
| cats
| 273
| 53
| 1
|-
| dogs
| 65
| 8,492
| 2
|-
| mice
| 1,649
| 548
| 3
|}
|
TemplateData
[edit]TemplateData for Vertical header
No description.
Parameter | Description | Typ | Status | |
---|---|---|---|---|
Text | 1 | no description | Content | optional |
No bold | nb | Set to use a normal font weight
| Unknown | optional |
Vertical alignment | va | no description
| String | optional |
Manual width | mw | Override the automatic generation based on the number of br line breaks
| Unknown | optional |
Cell additional classes | class | Additional classes for the cell, for example, |class=unsortable would stop the column from being sortable
| String | optional |
Div additional styles | style | Additional styles for the div containing the rotated text. | String | optional |
Cell additional styles | cellstyle | Additional styles for the entire cell. May contain double quotes. Use this not the cell's style="" attribute. Use background-color: not background: for sortable columns.
| String | optional |
See also
[edit]- {{Rotate text}}