style="background-color:#DCDCDC" | +
This template should not be substituted. |
This template automatically shades the table cell containing PVI data with the default party shading colors, autocalculates sort values for the given PVI value, and shows it in the form X+n format, where X is the party, and n is the degree of lean.
- For autocalculating the PVI value, and showing it in the form X+n format, without shading the table cell, use Template:PVI instead.
Usage
editCopy and paste the template below:
{{Shading PVI|<!-- Party name -->|<!-- Value -->}}
- NOTE:Additional table formatting such as rowspan= should be written just before this template, without any bar "|" (see #Using rowspan= subsection below). The style= tags however do not work (see #Unacceptable syntax subsection below).
For better understanding see Examples & TemplateData below.
Examples
editSample code | Result | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Acceptable syntax
{| class="wikitable sortable"
! District
! PVI
|-
| [[Virginia's 16th congressional district]]
| {{Shading PVI|R|6}}
|-
| [[Virginia's 17th congressional district]]
| {{Shading PVI|D|2}}
|-
| [[Virginia's 18th congressional district]]
| {{Shading PVI|Even}}
|-
| [[Virginia's 19th congressional district]]
| {{Shading PVI|party=R|value=20}}
|-
| [[Virginia's 20th congressional district]]
| {{Shading PVI|value=12|party=D}}
|-
| [[Virginia's 21st congressional district]]
| {{Shading PVI|1=D|2=13}}
|-
| [[Virginia's 22nd congressional district]]
| {{Shading PVI|Even|0}}
|}
|
||||||||||||||||||||
Unacceptable syntax
{| class="wikitable sortable"
! District
! PVI
|-
| [[New York's 31st congressional district]]
| {{Shading PVI|Republican|5}}
|-
| [[New York's 32nd congressional district]]
| {{Shading PVI|2|D}}
|-
| [[New York's 33rd congressional district]]
| {{Shading PVI|d|2}}
|-
| [[New York's 34th congressional district]]
| {{Shading PVI|even}}
|-
| [[New York's 35th congressional district]]
| {{Shading PVI|R|+7}}
|-
| [[New York's 36th congressional district]]
| style="color:green;" | {{Shading PVI|Even}}
|-
| [[New York's 37th congressional district]]
| style="color:green;" {{Shading PVI|Even}}
|-
| [[New York's 38th congressional district]]
| rowspan="2" | {{Shading PVI|R|2}}
|-
| [[New York's 39th congressional district]]
|}
|
| |||||||||||||||||||
Using rowspan=
(see New York's 38th congressional district example above to know what happens if a unwanted bar is used after rowspan tag.) {| class="wikitable sortable"
! District
! PVI
! Incumbent
|-
| rowspan="2" | [[Vermont's 1st congressional district]]
| rowspan="2" {{Shading PVI|R|8}}
| [[Abraham Lincoln]]
|-
| [[Andrew Johnson]]
|-
| [[Vermont's 2nd congressional district]]
| rowspan="2" {{Shading PVI|Even}}
| [[Franklin D. Roosevelt]]
|-
| [[Vermont's 3rd congressional district]]
| [[Theodore Roosevelt]]
|}
|
TemplateData
editNo description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Party | party 1 | Party name: Use D for Democratic-leaning, R for Republican-leaning & Even for Even districts.
| String | required |
Value | value 2 | Denotes the degree of Democratic/ Republican lean. Do not use any symbols before or after the number. Not required to specify for Even districts. | Number | required |