v3.1.0+
Status: | effective |
Progress: | 100% |
Version: | 3.1.0+ |
Demo:Table formats compared
From semantic-mediawiki.org
Help page · Ask questions · Post feedback
Please consider adopting examples to fit your environment since simple duplication may not create appropriate results.
Data presented on this page are for educational and demonstration purpose only.
Please consider adopting examples to fit your environment since simple duplication may not create appropriate results.
Data presented on this page are for educational and demonstration purpose only.
Table of Contents | |
---|---|
Table format[edit]
class=sortable wikitable smwtable[edit]
This is the default result format for queries with printout statements, so |format=table
does not need to be specified explicitly. Same applies to |class=sortable wikitable smwtable
which is the default class for this result format.
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain }}
- Result
City | Population | Size in km² |
---|---|---|
Berlin | 3,520,061 | 891.85 km²344.34 sqmi <br /> |
Munich | 1,353,186 | 310.43 km²119.86 sqmi <br /> |
Cologne | 1,080,394 | 405.02 km²156.38 sqmi <br /> |
Frankfurt | 679,664 | 248.31 km²95.87 sqmi <br /> |
Stuttgart | 606,588 | 207.35 km²80.06 sqmi <br /> |
Würzburg | 126,635 | 87.63 km²33.83 sqmi <br /> |
class=sortable table[edit]
This example uses the twitter bootstrap classes. It only works, because this wiki uses the "Chameleon" skin. When using Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x. and later and not using Chameleon use class sortable smwtable-clean
for a similar results.
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |class=sortable table }}
- Result
City | Population | Size in km² |
---|---|---|
Berlin | 3,520,061 | 891.85 km²344.34 sqmi <br /> |
Munich | 1,353,186 | 310.43 km²119.86 sqmi <br /> |
Cologne | 1,080,394 | 405.02 km²156.38 sqmi <br /> |
Frankfurt | 679,664 | 248.31 km²95.87 sqmi <br /> |
Stuttgart | 606,588 | 207.35 km²80.06 sqmi <br /> |
Würzburg | 126,635 | 87.63 km²33.83 sqmi <br /> |
class=sortable smwtable-clean[edit]
This is the default result format for queries with printout statements, so |format=table
does not need to be specified explicitly.
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |class=sortable smwtable-clean }}
- Result
City | Population | Size in km² |
---|---|---|
Berlin | 3,520,061 | 891.85 km²344.34 sqmi <br /> |
Munich | 1,353,186 | 310.43 km²119.86 sqmi <br /> |
Cologne | 1,080,394 | 405.02 km²156.38 sqmi <br /> |
Frankfurt | 679,664 | 248.31 km²95.87 sqmi <br /> |
Stuttgart | 606,588 | 207.35 km²80.06 sqmi <br /> |
Würzburg | 126,635 | 87.63 km²33.83 sqmi <br /> |
class=datatable[edit]
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |format=table |class=datatable }}
- Result
class=datatable compact cell-border[edit]
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |format=table |class=datatable compact cell-border }}
- Result
Broadtable format[edit]
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |format=broadtable }}
- Result
City | Population | Size in km² |
---|---|---|
Berlin | 3,520,061 | 891.85 km²344.34 sqmi <br /> |
Munich | 1,353,186 | 310.43 km²119.86 sqmi <br /> |
Cologne | 1,080,394 | 405.02 km²156.38 sqmi <br /> |
Frankfurt | 679,664 | 248.31 km²95.87 sqmi <br /> |
Stuttgart | 606,588 | 207.35 km²80.06 sqmi <br /> |
Würzburg | 126,635 | 87.63 km²33.83 sqmi <br /> |
Datatables format[edit]
Note that this result format is provided by extension "Semantic Result Formats"Provides additional formats for semantic queries.
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?Population |?Area#km²=Size in km² |mainlabel=City |sort=Population |order=descending |headers=plain |format=datatables }}
- Result