الگو:جدول انتخابات

از ویکی‌پدیا، دانشنامهٔ آزاد
توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

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:

{{جدول انتخابات|Table template pagename}}
'''Summary of [[مریخ|Martian]] election results,
۲۰۲۰'''
|-style="background:#E9E9E9;"
!colspan="2" align="left"|حزب
!رای
!%
!+/-
!Seats
!+/-
|-
|bgcolor="#d33"|
|align="left"|حزب سرخ
|۶۰۴۲
|۴۵٫۴۰
| -۴٫۴۱
|۲۳
| -۲
|-
|bgcolor="#00ff00"|
|align="left"|The green party
|۵۶۷۸
|۴۲٫۶۷
| +۱٫۲۳
|۲۱
|۰
|-
|bgcolor="#0000ff"|
|align="left"|Free Mars
|۳۴۵
|۲٫۵۹
| +۲٫۵۹
|۱
| +۱
|-
|bgcolor="#eaecf0"|
|align="left"|None of the above (unfilled seats)
|۱۲۴۲
|۹٫۳۳
| +.۵۹
|۵
| +۱
|-style="background:#E9E9E9;"
!colspan="2" align="left"|Total
!۱۳۳۰۷
!align="center" colspan="2"|۱۰۰%
!align="center" colspan="2"|۵۰
|}
و • ب Summary of Martian election results, 2020
حزب رای % +/- Seats +/-
حزب سرخ ۶۰۴۲ ۴۵٫۴۰ -۴٫۴۱ ۲۳
حزب سبز ۵۶۷۸ ۴۲٫۶۷ +۱٫۲۳ ۲۱ ۰
Free Mars ۳۴۵ ۲٫۵۹ +۲٫۵۹ ۱
None of the above (unfilled seats) ۱۲۴۲ ۹٫۳۳ +.۵۹ ۵
Total ۱۳۳۰۷ ۱۰۰% ۵۰

Options[ویرایش]

Instead of {{electiontable|template pagename}} '''Title''' you can use {{electiontable|template pagename|Title}}

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}}.