模板:Vertical header/doc:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
无编辑摘要
第1行: 第1行:
{{lua|Module:Vertical header}}
{{lua|Module:Vertical header}}
{|{{table|sort|class=floatright}}
{|{{table|sort|class=floatright}}
! {{vert header|stp=1|Regular column}}
! {{Vertical header|stp=1|Regular column}}
! {{vert header|stp=1|Vertical value column}}
! {{Vertical header|stp=1|Vertical value column}}
! {{vert header|stp=1|nb=1|cellstyle=background-color:gold|Thin gold column}}
! {{Vertical header|stp=1|nb=1|cellstyle=background-color:gold|Thin gold column}}
! {{vert header|nb=1|Unsortable column}}
! {{Vertical header|nb=1|Unsortable column}}
|-
|-
| 0 || {{vert header|va=middle|1}} || 1 || 2
| 0 || {{Vertical header|va=middle|1}} || 1 || 2
|-
|-
| 3 || {{vert header|va=middle|5}} || 8 || 13
| 3 || {{Vertical header|va=middle|5}} || 8 || 13
|-
|-
! {{vert header|va=top|Regular column}}
! {{Vertical header|va=top|Regular column}}
! {{vert header|va=top|Vertical value column}}
! {{Vertical header|va=top|Vertical value column}}
! {{vert header|nb=1|va=top|cellstyle=background-color:gold|Thin gold column}}
! {{Vertical header|nb=1|va=top|cellstyle=background-color:gold|Thin gold column}}
! {{vert header|nb=1|va=top|Unsortable column}}
! {{Vertical header|nb=1|va=top|Unsortable column}}
|}
|}
This is a template that helps create vertically-oriented column headers in tables. It even works for [[Help:Sorting|sortable]] columns.
This is a template that helps create vertically-oriented column headers in tables. It even works for [[Help:Sorting|sortable]] columns.
第31行: 第31行:


== Examples ==
== Examples ==
* <code><nowiki>! {{vert header|Your text here}}</nowiki></code> — basic example
* <code><nowiki>! {{Vertical header|Your text here}}</nowiki></code> — basic example
* <code><nowiki>! {{vert header|nb=1|stp=1|Your text here}}</nowiki></code> — produces an explicitly sortable, no-bold, sortable header  
* <code><nowiki>! {{Vertical header|nb=1|stp=1|Your text here}}</nowiki></code> — produces an explicitly sortable, no-bold, sortable header  
* <code><nowiki>! {{vert header|va=top|Your text here}}</nowiki></code> — produces an unsortable, top-aligned table header
* <code><nowiki>! {{Vertical header|va=top|Your text here}}</nowiki></code> — produces an unsortable, top-aligned table header
* <code><nowiki>! colspan="2" {{vert header|cellstyle=background-color:gold|Your text here}}</nowiki></code> — produces an unsortable header spanning two columns, with a gold background; use no vertical bar after <code>colspan</code>
* <code><nowiki>! colspan="2" {{Vertical header|cellstyle=background-color:gold|Your text here}}</nowiki></code> — produces an unsortable header spanning two columns, with a gold background; use no vertical bar after <code>colspan</code>


You can also use the <code><nowiki>! {{verth|Your text here}}</nowiki></code> shorthand.
You can also use the <code><nowiki>! {{verth|Your text here}}</nowiki></code> shorthand.


An example below (from [[Help:Sorting]]) with headers that span rows or columns (using ''rowspan'' and ''colspan''). '''Note''' that there is no vertical bar <code>|</code> between <code>rowspan=2</code> and <code>{{vert header</code>
An example below (from [[Help:Sorting]]) with headers that span rows or columns (using ''rowspan'' and ''colspan''). '''Note''' that there is no vertical bar <code>|</code> between <code>rowspan=2</code> and <code>{{Vertical header</code>


{|  
{|  
第45行: 第45行:
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! rowspan=2 {{vert header|stp=1|name}}
! rowspan=2 {{Vertical header|stp=1|name}}
! colspan=2 {{vert header|data columns}}
! colspan=2 {{Vertical header|data columns}}
! rowspan=2 {{vert header|stp=1|another column}}
! rowspan=2 {{Vertical header|stp=1|another column}}
|-
|-
! {{vert header|stp=1|data}}
! {{Vertical header|stp=1|data}}
! {{vert header|stp=1|more data}}
! {{Vertical header|stp=1|more data}}
|-
|-
| cats
| cats
第71行: 第71行:
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! rowspan=2 {{vert header|stp=1|name}}
! rowspan=2 {{Vertical header|stp=1|name}}
! colspan=2 {{vert header|data columns}}
! colspan=2 {{Vertical header|data columns}}
! rowspan=2 {{vert header|stp=1|another column}}
! rowspan=2 {{Vertical header|stp=1|another column}}
|-
|-
! {{vert header|stp=1|data}}
! {{Vertical header|stp=1|data}}
! {{vert header|stp=1|more data}}
! {{Vertical header|stp=1|more data}}
|-
|-
| cats
| cats