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

From semantic-mediawiki.org
(Redirected from The template format used to create a tabular output combined with math formats)
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
These examples require Semantic MediaWiki 1.9.2Released on 18 April 2014 and compatible with MW 1.19.0 - 1.22.x. or newer due to an enhancement to the userparam parameter.1 Note also the changes to the parameter names that were made in Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x..2

See this help page help page for further information.

Example without extra conditionals[edit]

{{#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
Berlin 3,520,061 891.85 km²
Cologne 1,080,394 405.02 km²
Frankfurt 679,664 248.31 km²
Munich 1,353,186 310.43 km²
Stuttgart 606,588 207.36 km²
Würzburg 126,635 87.63 km²
Average 1,227,754.667 358.433
Total 7,366,528 2,150.6


Example with additional conditionals[edit]

{{#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
Berlin 3,520,061 891.85 km²
Cologne 1,080,394 405.02 km²
Frankfurt 679,664 248.31 km²
Average 1,760,039.667 515.06
Total 5,280,119 1,545.18


Templates used to create the examples[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:217
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:3130