Template:Tabs

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

Purpose

Displays content in separate tabs. See also Template:Game Tabs.

Usage

Required ParametersAll Parameters
23581321
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 
}}
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 
}}
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 

|tab4= 
|content4= 

|tab5= 
|content5= 
}}
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 

|tab4= 
|content4= 

|tab5= 
|content5= 

|tab6= 
|content6= 

|tab7= 
|content7= 

|tab8= 
|content8= 
}}
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 

|tab4= 
|content4= 

|tab5= 
|content5= 

|tab6= 
|content6= 

|tab7= 
|content7= 

|tab8= 
|content8= 

|tab9= 
|content9= 

|tab10= 
|content10= 

|tab11= 
|content11= 

|tab12= 
|content12= 

|tab13= 
|content13= 
}}
{{Tabs
|tab1= 
|content1= 

|tab2= 
|content2= 

|tab3= 
|content3= 

|tab4= 
|content4= 

|tab5= 
|content5= 

|tab6= 
|content6= 

|tab7= 
|content7= 

|tab8= 
|content8= 

|tab9= 
|content9= 

|tab10= 
|content10= 

|tab11= 
|content11= 

|tab12= 
|content12= 

|tab13= 
|content13= 

|tab14= 
|content14= 

|tab15= 
|content15= 

|tab16= 
|content16= 

|tab17= 
|content17= 

|tab18= 
|content18= 

|tab19= 
|content19= 

|tab20= 
|content20= 

|tab21= 
|content21= 
}}
23581321
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 
}}
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 

|tab3= 
|tooltip3= 
|content3= 
}}
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 

|tab3= 
|tooltip3= 
|content3= 

|tab4= 
|tooltip4= 
|content4= 

|tab5= 
|tooltip5= 
|content5= 
}}
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 

|tab3= 
|tooltip3= 
|content3= 

|tab4= 
|tooltip4= 
|content4= 

|tab5= 
|tooltip5= 
|content5= 

|tab6= 
|tooltip6= 
|content6= 

|tab7= 
|tooltip7= 
|content7= 

|tab8= 
|tooltip8= 
|content8= 
}}
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 

|tab3= 
|tooltip3= 
|content3= 

|tab4= 
|tooltip4= 
|content4= 

|tab5= 
|tooltip5= 
|content5= 

|tab6= 
|tooltip6= 
|content6= 

|tab7= 
|tooltip7= 
|content7= 

|tab8= 
|tooltip8= 
|content8= 

|tab9= 
|tooltip9= 
|content9= 

|tab10= 
|tooltip10= 
|content10= 

|tab11= 
|tooltip11= 
|content11= 

|tab12= 
|tooltip12= 
|content12= 

|tab13= 
|tooltip13= 
|content13= 
}}
{{Tabs
|align= 
|columns= 
|default= 
|distribution= 
|position= 

|tab1= 
|tooltip1= 
|content1= 

|tab2= 
|tooltip2= 
|content2= 

|tab3= 
|tooltip3= 
|content3= 

|tab4= 
|tooltip4= 
|content4= 

|tab5= 
|tooltip5= 
|content5= 

|tab6= 
|tooltip6= 
|content6= 

|tab7= 
|tooltip7= 
|content7= 

|tab8= 
|tooltip8= 
|content8= 

|tab9= 
|tooltip9= 
|content9= 

|tab10= 
|tooltip10= 
|content10= 

|tab11= 
|tooltip11= 
|content11= 

|tab12= 
|tooltip12= 
|content12= 

|tab13= 
|tooltip13= 
|content13= 

|tab14= 
|tooltip14= 
|content14= 

|tab15= 
|tooltip15= 
|content15= 

|tab16= 
|tooltip16= 
|content16= 

|tab17= 
|tooltip17= 
|content17= 

|tab18= 
|tooltip18= 
|content18= 

|tab19= 
|tooltip19= 
|content19= 

|tab20= 
|tooltip20= 
|content20= 

|tab21= 
|tooltip21= 
|content21= 
}}
ParameterStatusDescriptionAccepted valuesDefault value
alignoptionalHorizontal alignment of the tab container and its contents.
  • left
  • center
left
columnsoptionalA number. If specified, the tab buttons will attempt to arrange themselves in N columns of equal width.
defaultoptionalA number. The index of the default tab.1
distributionoptionalIf set to stretch, the tab buttons will stretch to fill the space afforded by the tab container. Incompatible with columns.
  • stretch
positionoptionalThe vertical positioning of the tab buttons in relation to their content.
  • top
  • bottom
top
tabNrequiredThe label for the tab button.
tooltipNoptionalTooltip to display when hovering on the tab button. Must be plain text without markup.
contentNrequiredThe content to display for the tab.

Displays content in separate tabs.

Template parameters

ParameterDescriptionTypeStatus
alignalign

Horizontal alignment of the tab container and its contents.

Stringoptional
columnscolumns

A number. If specified, the tab buttons will attempt to arrange themselves in N columns of equal width.

Numberoptional
defaultdefault

A number. The index of the default tab.

Numberoptional
distributiondistribution

If set to <code>stretch</code>, the tab buttons will stretch to fill the space afforded by the tab container. Incompatible with <code>columns</code>.

Stringoptional
positionposition

The vertical positioning of the tab buttons in relation to their content.

Stringoptional
tab1tab1

The label for the tab button.

Stringrequired
tooltip1tooltip1

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
content1content1

The content to display for the tab.

Stringrequired
tab2tab2

The label for the tab button.

Stringrequired
tooltip2tooltip2

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
content2content2

The content to display for the tab.

Stringrequired
tab3tab3

The label for the tab button.

Stringrequired
tooltip3tooltip3

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
content3content3

The content to display for the tab.

Stringrequired
tab4tab4

The label for the tab button.

Stringrequired
tooltip4tooltip4

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
content4content4

The content to display for the tab.

Stringrequired
tab5tab5

The label for the tab button.

Stringrequired
tooltip5tooltip5

Tooltip to display when hovering on the tab button. Must be plain text without markup.

Stringoptional
content5content5

The content to display for the tab.

Stringrequired

Examples

#InputOutput
1
{{Tabs
|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
2
{{Tabs
|align= center

|tab1= Tab 1
|tooltip1= First Tab
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|tooltip2= Second Tab
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|tooltip3= Third Tab
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
3
{{Tabs
|align= center
|default= 2
|position= bottom

|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
Tab 1Tab 2Tab 3
4
{{Tabs
|distribution= stretch

|tab1= Tab 1
|content1= Content 1111111111111111111111111111111111

|tab2= Tab 2
|content2= Content 2222222222222222222222222222222222

|tab3= Tab 3
|content3= Content 3333333333333333333333333333333333
}}
Tab 1Tab 2Tab 3
Content 1111111111111111111111111111111111
Content 2222222222222222222222222222222222
Content 3333333333333333333333333333333333
5
{{Tabs
|align= center
|columns= 2

|tab1= [[File:OOS Spring.png|link=]]
|tooltip1= Spring
|content1= [[File:Holodrum Spring.png|300px]]

|tab2= [[File:OOS Summer.png|link=]]
|tooltip2= Summer
|content2= [[File:Holodrum Summer.png|300px]]

|tab3= [[File:OOS Autumn.png|link=]]
|tooltip3= Autumn
|content3= [[File:Holodrum Autumn.png|300px]]

|tab4= [[File:OOS Winter.png|link=]]
|tooltip4= Winter
|content4= [[File:Holodrum Winter.png|300px]]
}}
OOS Spring.pngOOS Summer.pngOOS Autumn.pngOOS Winter.png
Holodrum Spring.png
Holodrum Summer.png
Holodrum Autumn.png
Holodrum Winter.png
Wrap content in nowiki tabs when it contains pipe characters (e.g. tables)
6
{{Tabs
|tab1= Tab 1
|content1= 
<nowiki>
{| class="wikitable"
! Header 1 
! Header 2
|-
| A || B 
|-
| C || D
|}
</nowiki>

|tab2= Tab 2
|content2= 
<nowiki>
{| class="wikitable"
! Header 1 
! Header 2
|-
| D || E 
|-
| F || G
|}
</nowiki>
}}
Tab 1Tab 2
Header 1 Header 2
A B
C D
Header 1 Header 2
D E
F G

Guidelines

  • Tabs should represent the same kind of content. Don’t use tabs to group content that is dissimilar.
  • Tabs can be used to add a third dimension to data tables. See Kafei#Schedule, for example.
  • Images can be used as labels on the tab buttons. In this case you must remove the link from the image with link=, otherwise clicking on the tab will link to the file page instead of switching the tab.
  • Tabs should be clearly labeled and self-evident. If abbreviations must absolutely be used to save space – or if using images – include a tooltip to properly describe the tab.

Use on Other Wikis

If you are from another wiki and wish to have tabs on your wiki, here are instructions for copying over the code. Please give credit and link back to Zelda Wiki if you do so.

1. Copy the following pages:

2. Enable Extension:Gadgets on your wiki.

3. Add an entry to MediaWiki:Gadgets-definition on your wiki. Example

The above documentation is transcluded from Template:Tabs/Documentation. (edit | history)