Difference between revisions of "Template:Election table/doc"

From blackwiki
Jump to navigation Jump to search
imported>Akhristov
imported>Hildeoc
m (removed excess newline)
 
(45 intermediate revisions by 33 users not shown)
Line 1: Line 1:
<includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
+
<noinclude>{{Documentation subpage}}</noinclude>
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
==Usage==
+
 
 +
== Usage ==
 
This template marks the beginning of a table and defines borders, margins, background colours, and text alignment within the table. (Default alignment is "right", others must be specified.) Table rows and cells are written as usual, and the table is closed with "<code><nowiki>|}</nowiki></code>"
 
This template marks the beginning of a table and defines borders, margins, background colours, and text alignment within the table. (Default alignment is "right", others must be specified.) Table rows and cells are written as usual, and the table is closed with "<code><nowiki>|}</nowiki></code>"
  
 
For example, to have a table as shown below, include the code shown to the right:
 
For example, to have a table as shown below, include the code shown to the right:
{| align="right" style="margin:0 0 1em 2em;"
+
{| style="margin:0 0 1em 2em; float:right;"
|<small><pre>{{electiontable|Table template pagename}}
+
|<small><pre>{{electiontable|Table template pagename|Summary of [[Mars|Martian]] election results, 2020}}
'''Summary of [[Mars]]ian election results, [[2005]]'''
+
|-
|-style="background:#E9E9E9;"
+
! colspan="2" style="text-align:left;" | Parties
! align="left"|Parties
 
 
! Votes
 
! Votes
 
! %
 
! %
! +/-
+
! ±
 
! Seats
 
! Seats
! +/-
+
! ±
 
|-
 
|-
| align="left"|The Green Party
+
| style="background-color:#ff0000;" |
| 123,456
+
| style="text-align:left;" | The red party
| 79.2
+
| 6042
| -8.3
+
| 45.40
| 53
+
| −4.41
| -8
+
| 23
 +
| −2
 
|-
 
|-
| align="left"|The Red Party
+
| style="background-color:#00ff00;" |
| 23,697
+
| style="text-align:left;" | The green party
| 15.2
+
| 5678
| +6.6
+
| 42.67
| 10
+
| +1.23
| +4
+
| 21
 +
| 0
 
|-
 
|-
| align="left"|The Sun-Followers' Party
+
| style="background-color:#0000ff;" |
| 8,730
+
| style="text-align:left;" | Free Mars
| 5.6
+
| 345
| +1.7
+
| 2.59
| 4
+
| +2.59
| +4
+
| 1
|-style="background:#E9E9E9;"
+
| +1
! align="left"|Total
+
|-
! 155,883
+
| style="background-color:#eeeeee;" |
! align="center" colspan="2"|100%
+
| style="text-align:left;" | None of the above (unfilled seats)
! align="center" colspan="2"|67
+
| 1242
 +
| 9.33
 +
| +0.59
 +
| 5
 +
| +1
 +
|-
 +
! colspan="2" style="text-align:left;" | Total
 +
! 13307
 +
! style="text-align:center;" colspan="2"| 100%
 +
! style="text-align:center;" colspan="2"| 50
 
|}</pre></small>
 
|}</pre></small>
 
|}
 
|}
  
{{electiontable|Table template pagename}}'''Summary of [[Mars]]ian election results, [[2005]]'''
+
{{electiontable|Table template pagename|Summary of [[Mars|Martian]] election results, 2020}}
|-style="background:#E9E9E9;"
+
|-
! align="left"|Parties
+
! colspan="2" style="text-align:left;" | Parties
 
! Votes
 
! Votes
 
! %
 
! %
! +/-
+
! ±
 
! Seats
 
! Seats
! +/-
+
! ±
 +
|-
 +
| style="background-color:#ff0000;" |
 +
| style="text-align:left;" | The red party
 +
| 6042
 +
| 45.40
 +
| −4.41
 +
| 23
 +
| −2
 
|-
 
|-
| align="left"|The Green Party
+
| style="background-color:#00ff00;" |
| 123,456
+
| style="text-align:left;" | The green party
| 79.2
+
| 5678
| -8.3
+
| 42.67
| 53
+
| +1.23
| -8
+
| 21
 +
| 0
 
|-
 
|-
| align="left"|The Red Party
+
| style="background-color:#0000ff;" |
| 23,697
+
| style="text-align:left;" | Free Mars
| 15.2
+
| 345
| +6.6
+
| 2.59
| 10
+
| +2.59
| +4
+
| 1
 +
| +1
 
|-
 
|-
| align="left"|The Sun-Followers' Party
+
| style="background-color:#eeeeee;" |
| 8,730
+
| style="text-align:left;" | None of the above (unfilled seats)
| 5.6
+
| 1242
| +1.7
+
| 9.33
| 4
+
| +0.59
| +4
+
| 5
|-style="background:#E9E9E9;"
+
| +1
! align="left"|Total
+
|-
! 155,883
+
! colspan="2" style="text-align:left;" | Total
! align="center" colspan="2"|100%
+
! 13307
! align="center" colspan="2"|67
+
! style="text-align:center;" colspan="2"| 100%
 +
! style="text-align:center;" colspan="2"| 50
 
|}
 
|}
  
<includeonly>
+
== Options ==
 +
Instead of <code><nowiki>{{electiontable|template pagename}} Title</nowiki></code> you can use <code><nowiki>{{electiontable|template pagename|Title}}</nowiki></code>. The title will be bolded automatically.
 +
 
 +
To add <code><nowiki>class="sortable"</nowiki></code>, use <code><nowiki>...|sortable=yes}}</nowiki></code>. If you use this, you will need to edit your table to have <code><nowiki>|- class="sortbottom"</nowiki></code> as the row separator for the total row. If you want a specific column not to be sortable, specify <code><nowiki>class="unsortable"</nowiki></code> in the attributes of its header cell. Sorted tables do not currently work with tables using <code>colspan</code>. See [[meta:Help:Sorting|Help:Sorting]] for more information about sorting.
 +
 
 +
To align the table on the right side of the page, use <code><nowiki>...|align=right}}</nowiki></code>.
 +
 
 +
To suppress the editlink, use <code><nowiki>...|editlink=no}}</nowiki></code>.
  
<!-- ADD CATEGORIES BELOW THIS LINE -->
+
For direct use in an article instead of a template, use <code><nowiki>...|editlink=no|2=</nowiki>''Title''</code>.
[[Category:Elections templates]]
 
  
<!-- ADD INTERWIKIS BELOW THIS LINE -->
+
To collapse the table, use <code><nowiki>...|collapsed=yes</nowiki></code>
[[cs:šablona:volebnítabulka]]
 
[[uk:Шаблон:electiontable]]
 
  
</includeonly>
+
<includeonly>{{Sandbox other||
 +
[[Category:Election and referendum result templates]]
 +
[[Category:Table templates]]
 +
}}</includeonly>

Latest revision as of 03:04, 23 November 2020

Usage

This template marks the beginning of a table and defines borders, margins, background colours, and text alignment within the table. (Default alignment is "right", others must be specified.) Table rows and cells are written as usual, and the table is closed with "|}"

For example, to have a table as shown below, include the code shown to the right:

{{electiontable|Table template pagename|Summary of [[Mars|Martian]] election results, 2020}}
|-
! colspan="2" style="text-align:left;" | Parties
! Votes
! %
! ±
! Seats
! ±
|-
| style="background-color:#ff0000;" |
| style="text-align:left;" | The red party
| 6042
| 45.40
| −4.41
| 23
| −2
|-
| style="background-color:#00ff00;" |
| style="text-align:left;" | The green party
| 5678
| 42.67
| +1.23
| 21
| 0
|-
| style="background-color:#0000ff;" |
| style="text-align:left;" | Free Mars
| 345
| 2.59
| +2.59
| 1
| +1
|-
| style="background-color:#eeeeee;" |
| style="text-align:left;" | None of the above (unfilled seats)
| 1242
| 9.33
| +0.59
| 5
| +1
|-
! colspan="2" style="text-align:left;" | Total
! 13307
! style="text-align:center;" colspan="2"| 100%
! style="text-align:center;" colspan="2"| 50
|}
[{{fullurl:Template:Transclude|action=edit}} e] • [[|d]] Summary of Martian election results, 2020
Parties Votes % ± Seats ±
The red party 6042 45.40 −4.41 23 −2
The green party 5678 42.67 +1.23 21 0
Free Mars 345 2.59 +2.59 1 +1
None of the above (unfilled seats) 1242 9.33 +0.59 5 +1
Total 13307 100% 50

Options

Instead of {{electiontable|template pagename}} Title you can use {{electiontable|template pagename|Title}}. The title will be bolded automatically.

To add class="sortable", use ...|sortable=yes}}. If you use this, you will need to edit your table to have |- class="sortbottom" as the row separator for the total row. If you want a specific column not to be sortable, specify class="unsortable" in the attributes of its header cell. Sorted tables do not currently work with tables using colspan. See Help:Sorting for more information about sorting.

To align the table on the right side of the page, use ...|align=right}}.

To suppress the editlink, use ...|editlink=no}}.

For direct use in an article instead of a template, use ...|editlink=no|2=Title.

To collapse the table, use ...|collapsed=yes