Template:Vertical header/doc

From WikiProjectMed
Jump to navigation Jump to search
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 or 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

  • ! {{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 after colspan

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...}}

name
data columns
another column
data
more data
cats 273 53 1
dogs 65 8,492 2
mice 1,649 548 3
{| 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

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Vertical header in articles based on its TemplateData.

TemplateData for Vertical header

No description.

Template parameters

ParameterDescriptionTypeStatus
Text1

no description

Contentoptional
No boldnb

Set to use a normal font weight

Suggested values
y
Unknownoptional
Vertical alignmentva

no description

Suggested values
bottom top middle
Default
bottom
Stringoptional
Manual widthmw

Override the automatic generation based on the number of br line breaks

Example
5em
Unknownoptional
Cell additional classesclass

Additional classes for the cell, for example, |class=unsortable would stop the column from being sortable

Example
unsortable
Stringoptional
Div additional stylesstyle

Additional styles for the div containing the rotated text.

Stringoptional
Cell additional stylescellstyle

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.

Example
background-color:red
Stringoptional

See also