Template:ElectionResult/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

This template is used to add information on election articles or lists on Wikipedia. It provides an easier input for election data inside a table.

The template must be placed inside the table in the article as this:

{| class="wikitable plainrowheaders" style="text-align:center;"
|+
! scope="col" rowspan="" style="width:10em;" height="75" | Region
! scope="col" rowspan="" style="width:14em;" | 1
! scope="col" rowspan="" style="width:18em;" | 2
! scope="col" rowspan="" style="width:3em;" | 3
! scope="col" rowspan="" style="width:8em;" | 4
|-
!scope="row" rowspan="3" align="center"|Region
{{ElectionResult|1|2|3|4|W}}
{{ElectionResult|1|2|3|4}}
{{ElectionResult|1|2|3|4}}
|-
|}

Fields

[edit source]

The template has 4 non-designated fields that may vary on each table and an specific parameter to designate the winning candidate. The first four parameter of the table have no name and can be stablished differently depending on the info that will be shown. To determine the winning candidate, add a W as the last parameter on the template, as this:

  • {{ElectionResult|1|2|3|4|W}}

Examples with table layout

[edit source]

Example with dummy data

[edit source]

Since this template produces only individual rows within a table, you will need to add (or already have) the table's framework in the article. Here is an example using an already stablished table with its corresponding output:

{| class="wikitable plainrowheaders" style="text-align:center;"
|+
! scope="col" rowspan="" style="width:10em;" | Region
! scope="col" rowspan="" style="width:14em;" | Affiliation
! scope="col" rowspan="" style="width:18em;" | Candidate
! scope="col" rowspan="" style="width:3em;" | %
! scope="col" rowspan="" style="width:8em;" | Votes
|-
!scope="row" rowspan="3" align="center"|Region
{{ElectionResult|Affiliation 1|Candidate 1|Percentage 1|Votes 1|W}}
{{ElectionResult|Affiliation 2|Candidate 2|Percentage 2|Votes 1|}}
{{ElectionResult|Affiliation 3|Candidate 3|Percentage 3|Votes 1|}}
|-
|}

Will produce this:

Region Affiliation Candidate % Votes
Region

User:Hahc21/ElectionResult User:Hahc21/ElectionResult User:Hahc21/ElectionResult

Example with realistic data

[edit source]

Example using chart data from Venezuelan regional elections, 2008:

{| class="wikitable plainrowheaders" style="text-align:center;"
|+
! scope="col" rowspan="" style="width:10em;" | Metropolitan Area
! scope="col" rowspan="" style="width:14em;" | Affiliation
! scope="col" rowspan="" style="width:18em;" | Candidate
! scope="col" rowspan="" style="width:3em;" | %
! scope="col" rowspan="" style="width:8em;" | Votes
|-
!scope="row" rowspan="3" align="center"|Caracas
{{ElectionResult|Opposition|[[Antonio Ledezma]]|52.40|708,547|W}}
{{ElectionResult|Government|[[Aristóbulo Istúriz]]|44.97|608,138}}
{{ElectionResult|Independent|Augusto Uribe|1.97|26,652}}
|-
!scope="row" rowspan="3" align="center"|Alto Apure
{{ElectionResult|Government|Jorge Rodriguez|55.92|21,381|W}}
{{ElectionResult|Independent|Elfar Angarita|20.86|7,979}}
{{ElectionResult|Opposition|Ignacio Barrillas|20.21|7,728}}
|-
|}

Expands into:

Metropolitan Area Affiliation Candidate % Votes
Caracas

User:Hahc21/ElectionResult User:Hahc21/ElectionResult User:Hahc21/ElectionResult

Alto Apure

User:Hahc21/ElectionResult User:Hahc21/ElectionResult User:Hahc21/ElectionResult