The template format used to create a tabular output combined with math formats

From semantic-mediawiki.org
Jump to: navigation, search
ExamplesExamples/QueriesThe template format used to create a tabular output combined with math formats
Templates for joining output
This page shows an example for the template format used to create a tabular output combined with math formats.
Format
Keywords
Table of Contents

NoteNote:  These examples require Semantic MediaWiki 1.9.2 or newer due to an enhancement to the userparam= parameter.1 See this help page help page for further information.

Example without extra conditionals

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?population
 |?area#km²
 |template=Template/Math/Table
 |introtemplate=Template/Math/Table/Intro
 |outrotemplate=Template/Math/Table/Outro
 |format=template
 |link=none
}}
This produces the following output
City Population Area
Demo:Berlin 3,520,061 891.85 km²
Demo:Cologne
Frankfurt 679,664 248.31 km²
Munich 1,353,186 310.43 km²
Stuttgart 606,588 207.36 km²
Demo:Würzburg
Average 1,539,874.75 414.4875
Total 6,159,499 1,657.95


Example with additional conditionals

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?population
 |?area#km²
 |template=Template/Math/Table
 |introtemplate=Template/Math/Table/Intro
 |outrotemplate=Template/Math/Table/Outro
 |format=template
 |link=none
 |limit=3
 |searchlabel=
}}
This produces the following output
City Population Area
Demo:Berlin 3,520,061 891.85 km²
Demo:Cologne
Frankfurt 679,664 248.31 km²
Average 2,099,862.5 570.08
Total 4,199,725 1,140.16


Templates used to create the examples