From Wikipedia, the free encyclopedia
This template uses Lua :
This template does the same thing as { { Example Stack } } with | style = wikitable. For example:
{{Example Table|t=#invoke:Example|spaced=1
|1=count_fruit\apples=3\bananas=5
|2=count_fruit\apples=1\bananas=1
|3=count_fruit\apples=Not a number\bananas=Not a number
}}
produces the following:
Code Result
{{ #invoke : Example | count_fruit | apples = 3 | bananas = 5 }}
I have 5 bananas and 3 apples
{{ #invoke : Example | count_fruit | apples = 1 | bananas = 1 }}
I have 1 banana and 1 apple
{{ #invoke : Example | count_fruit | apples = Not a number | bananas = Not a number }}
I have 0 bananas and 0 apples
See { { Example Stack } } for details of the available parameters and how to specify each set of example parameters.
Additional settings [ edit ]
Set | wide = to a true value (yes) to make the table span the full available width.
Set | inthemiddle = to a true value (yes) to generate only table rows, rather than a complete table.
Syntax highlighting is enabled by default. Use | syntaxhighlight = no to disable it.
Template parameters[ Edit template data ]
This template prefers block formatting of parameters.
Parameter Description Type Status Example 1 1First set of example arguments, separated by backslashes. Produces one table row
Example count_fruit\apples=3\bananas=5 String suggested Example 2 2Second set of example arguments, separated by backslashes. Produces another table row.
Example count_fruit\apples=1\bananas=1 String optional Example 3 3Third set of example arguments, separated by backslashes
Example count_fruit\apples=Not a number\bananas=Not a number String optional Example 4 4Fourth set of example arguments, separated by backslashes
String optional Example 5 5Fifth set of example arguments, separated by backslashes
String optional Template or module t templateName of the template to demonstrate, without the Template: prefix. For a Lua module, use #invoke:ModuleName
Default The current page name up to the first slash Example #invoke:Example Line suggested Full-width table wideMakes the generated table span the full available width. Has no effect when inthemiddle is enabled
Default 0 Example 1 Boolean optional Rows only inthemiddleGenerates only table rows, omitting the table opening, column headings and closing markup
Default 0 Example 1 Boolean optional Display style styleLayout preset applied to all examples
Suggested values wikitable pre *pre pre↓ *pre↓Default wikitable Line optional Cell separator sepWikitext separating each displayed invocation from its rendered output
Default
| Content optional Prevent code wrapping nobrPrevents automatic line wrapping within the displayed example code
Default 0 Example 1 Boolean optional Space parameters spacedAdds spaces between parameters in each displayed invocation
Default 0 Example 1 Boolean optional Suppress categories nocatSuppresses categories only if the demonstrated template or module supports that parameter
Default 0 Example 1 Boolean optional Prefix prefixText placed before each invocation in the displayed code and before its rendered output. Can be overridden within an example using \_prefix=.
Content optional Postfix postfixText placed after each invocation in the displayed code and after its rendered output. Can be overridden within an example using \_postfix=.
Content optional Row opener openerWikitext placed at the start of each example
Default |-
| String optional Between examples betweenAdditional wikitext inserted between example rows
Default An empty string Content optional Syntax highlighting syntaxhighlightUses wikitext syntax highlighting
Default 1 Example 0 Boolean optional Trim whitespace trimTrims leading and trailing whitespace from example sets
Default 1 Example 0 Boolean optional