الگو:الگوهای خانه جدول

از اسلامیکال
پرش به ناوبری پرش به جستجو
{{{1|{{{متن}}}}}}
توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

The templates in this series are designed to be used in a راهنما:جدول‌ها to make a cell with text in that cell, with an appropriately colored background. They are commonly used in رده:مقایسه‌ها.

For example, {{yes}} makes a cell with a green background. The text in the cell is taken from the راهنما:الگو; {{yes|Sure}} would output "Sure" otherwise it defaults to "Yes". Most templates allow authors to override the default text in this way, some require text put after the template call and some also need a vertical bar in between: {{table cell template}} text or {{table cell template}} | text. This information, the colors and default texts are found in the table below.

If you want to use other attributes for the table cells, e.g. colspan or rowspan, they need to be put before the template call and there must be no vertical bar | in between them:

آری نه ن/م
آری/نه
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...

الگوها

الگوهای خانه جدول
کلاس[۱] دستورات پیش‌فرض پیش‌نمایش (پیش‌فرض) دستورات سفارشی پیش‌نمایش (سفارشی)
table-rh {{rh}} | Row header[۲] Row header {{rh|align=right}} | Row header Row header
{{rh2}} | Row header[۲] Row header {{rh2|align=right}} | Row header Row header
table-yes {{yes}} آری {{yes|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
{{ya}} Yes {{ya|Customized alt text|link=WP:ALT}} Customized alt text
table-no {{no}} نه {{no|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
{{na}} Red XN {{na|Customized alt text|link=WP:ALT}} Red XN
{{coming soon}} به‌زودی
{{bad}} بد {{bad|F}} F
{{eliminated}} حذف‌شده
table-siteactive {{site active}} فعال
table-siteinactive {{site inactive}} غیرفعال
table-yes2 {{good}} خوب {{good|A}} A
{{yes2}} {{yes2|Text}} Text
{{won}} برنده {{won|text=white|color=darkblue}} برنده
{{won|place=1}} برنده {{won|place=Gold}} برنده
{{won|place=2}} برنده {{won|place=Silver}} برنده
{{won|place=3}} برنده {{won|place=Bronze}} برنده
table-no2 {{no2}} {{no2|Text}} Text
{{nom}} نامزدشده {{nom|5}} 5
{{sho}} کوتاه‌شده
{{TBA}} ن/م {{TBA|To be announced}} To be announced
table-partial {{partial}} بخشی {{partial|Almost done}} Almost done
{{yes-No}} آری/نه
{{okay}} بی‌طرف {{okay|C}} C
{{some}} برخی
table-any {{any}} هیچ
table-na {{n/a}} ن/م
{{BLACK}} ن/م
table-unknown {{dunno}} ؟ {{dunno|Custom [[نوشته ساده]]}} Custom نوشته ساده
{{unknown}} ناشناخته {{unknown|?}} ?
table-depends {{depends}} وابسته {{depends|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-included {{included}} گنجانده‌شده
table-dropped {{dropped}} رهاشده
{{terminated}} پایان‌یافته
table-beta {{beta}} بتا
{{table-experimental}} آزمایشی {{table-experimental|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-maybe {{شاید}} شاید {{maybe|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-free {{free}} رایگان {{free|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-proprietary {{مالکیتی}} مالکیتی {{proprietary|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-nonfree {{nonfree}} غیر آزاد {{nonfree|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-needs {{needs}} نیاز است {{needs|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-nightly {{nightly}} ساخت شبانه {{nightly|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
table-release-candidate {{release-candidate}} نامزد انتشار {{release-candidate|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
no class {{draw}} {{draw|Text}} Text
no class {{incorrect}} نادرست {{incorrect|سفارشی [[نوشته ساده]]}} سفارشی نوشته ساده
no class {{no result}} بی‌نتیجه {{no result|N.R.}} N.R.
no class {{pending}} در جریان
no class {{unofficial}} غیررسمی
no class {{usually}} معمولاً
no class {{rarely}} به ندرت
no class {{sometimes}} گاهی
no class {{CMain}} اصلی
no class {{CRecurring}} دوره‌ای
no class {{CGuest}} مهمان
no class {{active fire}} فعال (12%)
no class {{contained}} مشمول

کد

Common code to most if not all the templates in this series:

style="background: white; color: black; vertical-align: middle; text-align: {{{هم‌ترازی|center}}}; {{{سبک|}}}" class="الگوهای خانه جدول table-الگوهای خانه جدول"| {{{1|{{{متن}}}}}}

Code specific to this template:

style="background: white; color: black; vertical-align: middle; text-align: {{{هم‌ترازی|center}}}; {{{سبک|}}}" class="الگوهای خانه جدول table-الگوهای خانه جدول"| {{{1|{{{متن}}}}}}

To make a new table cell template you can use:

style="background: white; color: black; vertical-align: middle; text-align: <nowiki>{{{هم‌ترازی|</nowiki>center<nowiki>}}}</nowiki>; <nowiki>{{{سبک|}}}</nowiki>" class="{{BASEPAGENAME}} table-{{BASEPAGENAME}}"| <nowiki>{{{1|</nowiki>{{{متن}}}<nowiki>}}}</nowiki>

You should leave out the align parameter and often the class parameter is unnecessary, too.

Add the new template to the table in the common documentation afterwards. Please consider reusing one of the other templates and please choose the color sensibly.

If you find a table cell template that does not take a parameter and you want to be able to change the text in the cell, do not duplicate the template! Instead, edit the template and change the text to a default parameter substitution. For example, if a template's text is Dropped, change that to {{{1|Dropped}}}.

جستارهای وابسته

  • {{GPL-lic}}
  • {{chg}}: calculate and display changes between two values

پانویس

  1. The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
  2. ۲٫۰ ۲٫۱ Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.