Jump to content

Template:Get cell/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
Line 54: Line 54:
| 339,996,564
| 339,996,564
| 9,833,517
| 9,833,517
| {{Get cell|A2|population-table|Template:Get cell/doc}}
| {{Get cell||population-table|Template:Get cell/doc}}
|}
|}

Revision as of 12:47, 30 April 2024

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}} round 0 }}
|-
| China
| 1,425,671,352
| 9,600,000
| {{#expr: {{Get cell|C2|population-table}} / {{Get cell|C3|population-table}} round 0 }}
|-
| United States
| 339,996,564
| 9,833,517
| {{#expr: {{Get cell|D2|population-table}} / {{Get cell|D3|population-table}} round 0 }}
|}

Will output the following table:

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