Demo:Standard table examples

From semantic-mediawiki.org
This demo page is about result format "Table"Outputs the results in a table (default for queries with printout statements).. If you would like to use result format "Broadtable"Outputs the results in a broad table. just add |format=broadtable to the example queries provided.
Table of Contents


Simple table example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |mainlabel=City
}}

This produces the following output:

CityPopulationThe number of inhabitants of some geographical place.Size in km²
Berlin3,520,061891.85 km²344.34 sqmi
Cologne1,080,394405.02 km²156.38 sqmi
Frankfurt679,664248.31 km²95.87 sqmi
Munich1,353,186310.43 km²119.86 sqmi
Stuttgart606,588207.36 km²80.06 sqmi
Würzburg126,63587.63 km²33.83 sqmi

"class" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |mainlabel=City
 |class=datatable
}}

This produces the following output:

CityPopulationThe number of inhabitants of some geographical place.Size in km²
Berlin3,520,061891.85 km²344.34 sqmi
Cologne1,080,394405.02 km²156.38 sqmi
Frankfurt679,664248.31 km²95.87 sqmi
Munich1,353,186310.43 km²119.86 sqmi
Stuttgart606,588207.36 km²80.06 sqmi
Würzburg126,63587.63 km²33.83 sqmi

"transpose" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Size in km²
 |format=table
 |transpose=true
 |mainlabel=City
}}

This produces the following output:

CityBerlinCologneFrankfurtMunichStuttgartWürzburg
PopulationThe number of inhabitants of some geographical place.3,520,0611,080,394679,6641,353,186606,588126,635
Size in km²891.85 km²344.34 sqmi
405.02 km²156.38 sqmi
248.31 km²95.87 sqmi
310.43 km²119.86 sqmi
207.36 km²80.06 sqmi
87.63 km²33.83 sqmi

"sep" parameter example[edit]

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Has point of interest=Point of Interest
 |format=table
 |sep=, 
 |mainlabel=City
}}

This produces the following output:

CityPoint of Interest
BerlinBrandenburg Gate, Museumsinsel, Reichstag
Cologne
Frankfurt
MunichDom zu Unserer Lieben Frau, Schloss Nymphenburg
Stuttgart
Würzburg

The output without using the "sep" parameter (default behaviour):

CityPoint of Interest
BerlinBrandenburg Gate
Museumsinsel
Reichstag
Cologne
Frankfurt
MunichDom zu Unserer Lieben Frau
Schloss Nymphenburg
Stuttgart
Würzburg