Jump to content

Template:Get cell/doc

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sophivorus (talk | contribs) at 12:12, 30 April 2024 (Update docs). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This template serves to calculate a table cell out of the values of other cells.

Example

The following wikitext:

{| class="wikitable" id="population-table"
! Country
! Population
! Area
! Density
|-
| Argentina
| 45,773,884
| 2,796,427
| {{#expr: {{Get cell|B2|population-table}} / {{Get cell|B3|population-table}} }}
|-
| China
| 1,425,671,352
| 9,600,000
| {{#expr: {{Get cell|C2|population-table}} / {{Get cell|C3|population-table}} }}
|-
| United States
| 339,996,564
| 9,833,517
| {{#expr: {{Get cell|D2|population-table}} / {{Get cell|D3|population-table}} }}
|}

Will output the following table:

Country Population Area Density
Argentina 45,773,884 2,796,427 16.368703348952
China 1,425,671,352 9,600,000 148.5074325
United States 339,996,564 9,833,517 34.575275966879