This module provides basic functions for interacting with tabular data on Wikimedia Commons.
cell
Returns the value of the cell at the given row index and column name.
Usage:
A row index of 1
refers to the first row in the table. A row index of -1
refers to the last row in the table. It is an error to specify a row index of 0
.
Latest death toll in (regardless of when the table was last updated):
lookup
Returns the value of the cell(s) in one or more output columns of the row matching the search key and column.
This function is reminiscent of LOOKUP
macros in popular spreadsheet applications, except that the search key must match exactly. (On the other hand, this means the table does not need to be sorted.)
Usage:
If multiple columns are output without an explicit string format, this function formats the output as a human-readable list.
Some may find (which uses this module) an intuitive way to obtain cell data as it resembles a simple SQL query.
1
refers to the first matching row. A row index of -1
refers to the last matching row. It is an error to specify a row index of 0
.
Total confirmed case count in on the day that the county issued a stay-at-home order:
The last day that a hundred or more patients with COVID-19 were in the hospital in :
Total number of administrators on all Wikimedia wikis using :
Number of administrators and users on all Wikimedia wikis using :
Note: Wikipedia statistics are shown as an illustration only. In practice, there is a high-performance module to access Wikipedia statistics.
wikitable
Returns the entire data table as a (rather plain) table.
Usage:
The implementation of this function incorporates (to represent null values), (true), and (false). The templates themselves cannot be reused because they are incompatible with the mw.html
library, which builds the table using an HTML DOM instead of pure wikitext.
You can most likely port this template to a wiki in another language without making major modifications. The wikitable
function automatically localizes the table's description, column titles, and license name into the wiki's content language. It also formats numbers according to the content language. However, you should localize the cells representing true
, false
, and null
by changing the values in the messages
, bgColors
, and colors
variables to match the wiki's own,, and templates, respectively.