Help:Broadtable format 0.4 - 1.6.1
| Broadtable format 0.4 - 1.6.1 | ||
|---|---|---|
| Outputs the result in a broad table. | ||
| Further Information | ||
| Provided by: | Semantic MediaWiki | |
| Added: | 0.4 | |
| Removed: | still supported | |
| Requirements: | none | |
| Format name: | broadtable | |
| Enabled by default:info.pngIndicates whether the result format is enabled by default upon installation of the respective extension. | yes | |
| Authors: | Markus Krötzsch | |
| Categories: | misc | |
| Table of Contents | ||
| ||
The result format broadtable is used to format query results as tables. It is identical to the table format except that the broadtable stretches the table to 100% of the available width.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| intro | Text | empty | The text to display before the query results, if there are any |
| outro | Text | empty | The text to display after the query results, if there are any |
| default | Text | empty | The text to display if there are no query results |
| class | Text | sortable wikitable smwtable | An additional CSS class to set for the table |
There are no inline query parameters specific to the broadtable format. The parameter headers=hide is specifically useful for hiding the header of tables (in most other cases, it is enough to use empty printout labels to hide the titles of printout statements).
Example
{{#ask: [[Category:City]] [[located in::Germany]]
| ?population
| ?area#km² = Size in km²
| format=broadtable
}}
This produces the following output:
| Population | Size in km² | |
|---|---|---|
| Berlin | 3,391,409 | 891.85 km²344.343 sqmi |
| Frankfurt | 679,664 | 248.31 km²95.872 sqmi |
| Munich | 1,353,186 | 310.43 km²119.857 sqmi |
| Stuttgart | 606,588 | 207.36 km²80.062 sqmi |
Remarks
Tables have a special feature for sorting their contents by any of the columns in the table. See Help:Selecting pages for general comments on sorting and a comparison to the wiki's query result sorting. Browsers without JavaScript enabled will not see the buttons for sorting at all.
SMW formats its tables with CSS class="smwtable". Using this class on other tables to achieve similar formatting is possible, but will only work reliably if the according page contains a query or other SMW specific elements. In other cases, the SMW style files will not be loaded at all, so the style is not available.