Template:Tabber/doc

From Elwiki

Overview

This is the refreshed version of Template:Tabs and what you should be using for making tabs now. This version is enhanced with Mobile Frontend support and is generally cleaned up. Also, the syntax has been updated.

Parameters

 Tip: All parameters get parsed as tab=content, unless they start with the $ sign.
  • $containerclass - adds a custom class to the wrapper of the tabs
  • $containerstyle - adds a style to the wrapper of the tabs
  • $tab[number]style - adds styles to the tab on the specified index
  • $tab[number]style - adds styles to the content box on the specified index
  • $tabstyle - adds styles to tabs
  • $contentsstyle - adds styles to content boxes

Example usage

{{Tabber
|$containerclass=test
|Orange=Content of tab 1
|Banana=Content of tab 2
|Grape=Content of tab 3
|Pie=Content of tab 4
}}

Result:

  • Orange
  • Banana
  • Grape
  • Pie

Content of tab 1

  Tip: Nested tabs are also supported.
  • Tab 1
  • Tab 2
  • Tab 3
  • Tab 4
  • Tab 1
  • Tab 2
  • Tab 3
  • Tab 4

Content of tab 1

  Warning: Templates do not work well with tables and other templates, but there is a workaround for that. Before providing the parameter's value that contains MediaWiki markup, use <dfn>{{</dfn> and insert <dfn>}}</dfn> at the end of the parameter's value. Do note that this embeds a little line break. Using this is not required until you notice that something breaks.

Use like so:

  • Tab 1
  • Tab 2

{{

Orange Apple
Bread Pie
Butter Ice cream

}}

{{Tabber
|$containerclass=test
|Tab 1=<dfn>{{</dfn>
{| class="wikitable"
|'''Orange'''
|'''Apple'''
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
<dfn>}}</dfn>
|Tab 2=Content of tab 2
}}