Lompat ke isi

Templat:Table cell templates/doc: Perbedaan antara revisi

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Konten dihapus Konten ditambahkan
MerlIwBot (bicara | kontrib)
RyanJulian21 (bicara | kontrib)
Baris 20: Baris 20:


=== Templates in this series ===
=== Templates in this series ===

{| class="wikitable"
{| class="wikitable"
|+ Table cell templates
|+ Table cell templates
! Class<ref name="table-cell-templates-table-css">The HTML class of table cell templates may be referenced in a [[m:help:User style|user stylesheet]] to change appearance.</ref> !! Template !! Preview !! Preview, alternative
! Class<ref name="table-cell-templates-table-css">The HTML class of table cell templates may be referenced in a [[m:help:User style|user stylesheet]] to change appearance.</ref> !! Default syntax !! Preview (default) !! Customized syntax !! Preview (customized)
|-
|-
|rowspan=2| <code>table-rh</code> || {{Tl|rh}} | Row header || {{rh}} | Row header ||
|rowspan=2| <code>table-rh</code> || {{Tl|rh}} {{!}} Row header<ref name="table-cell-templates-table-after+pipe" /> || {{rh}} | Row header || {{tlp|rh|2=align=right}} {{!}} Row header || {{rh|align=right}} | Row header
|-
|-
| {{Tl|rh2}}<ref name="table-cell-templates-table-after+pipe">Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.</ref> | Row header || {{rh2}} | Row header ||
| {{Tl|rh2}} {{!}} Row header<ref name="table-cell-templates-table-after+pipe">Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.</ref> || {{rh2}} {{!}} Row header || {{tlp|rh2|2=align=right}} | Row header || {{rh2|align=right}} | Row header
|-
|-
| <code>table-yes</code> || {{Tl|yes}}, {{Tlp|yes|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{yes}} ||{{yes|Alternative [[Plain text|text]]}}
|rowspan=2| <code>table-yes</code> || {{Tl|yes}} || {{yes}} || {{Tlp|yes|<nowiki>Customized [[Plain text|text]]</nowiki>}} ||{{yes|Customized [[Plain text|text]]}}
|-
|-
|rowspan=3| <code>table-no</code> || {{Tl|no}}, {{Tlp|no|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{no}} ||{{no|Alternative [[Plain text|text]]}}
| {{tl|ya}} || {{Ya}} || {{tlp|ya|Customized alt text|link{{=}}WP:ALT}} || {{Ya|Customized alt text|link=WP:ALT}}
|-
|-
|rowspan=5| <code>table-no</code> || {{Tl|no}} || {{no}} || {{Tlp|no|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{no|Customized [[Plain text|text]]}}
| {{Tl|coming soon}} || {{coming soon}} ||
|-
|-
| {{Tl|bad}}, {{Tlp|bad|F}} || {{bad}} || {{bad|F}}
| {{tl|na}} || {{Na}} || {{tlp|na|Customized alt text|link{{=}}WP:ALT}} || {{Na|Customized alt text|link=WP:ALT}}
|-
|-
| <code>table-siteactive</code> || {{Tl|Site active}} || {{site active}} ||
| {{Tl|coming soon}} || {{coming soon}} || ||
|-
|-
| <code>table-siteinactive</code> || {{Tl|Site inactive}} || {{site inactive}} ||
| {{Tl|bad}} || {{bad}} || {{Tlp|bad|F}} || {{bad|F}}
|-
|-
| {{Tl|eliminated}} || {{eliminated}} || ||
|rowspan=7| <code>table-yes2</code> || {{Tl|yes2}}<ref name="table-cell-templates-table-after"/> Text || {{yes2}}Text ||
|-
|-
| {{Tl|won}}, {{Tlp|won|5}} || {{won}} || {{won|5}}
| <code>table-siteactive</code> || {{Tl|site active}} || {{site active}} || ||
|-
|-
| <code>table-siteinactive</code> || {{Tl|site inactive}} || {{site inactive}} || ||
| <nowiki>{{won|place=1}} or =Gold</nowiki> || {{won|place=1}} ||
|-
|-
| <nowiki>{{won|place=2}} or =Silver</nowiki> || {{won|place=2}} ||
|rowspan=6| <code>table-yes2</code> || {{Tl|good}} || {{good}} || {{Tlp|good|A}} || {{good|A}}
|-
|-
| <nowiki>{{won|place=3}} or =Bronze</nowiki> || {{won|place=3}} ||
| {{Tl|yes2}} || {{yes2}} || {{Tlp|yes2|Text}} || {{yes2|Text}}
|-
|-
| <nowiki>{{won|text=white|color=blue}} or =#1122CC</nowiki> || {{won|text=white|color=blue}} ||
| {{Tl|won}} || {{won}} || {{Tlp|won|text{{=}}white|color{{=}}darkblue}} || {{won|text=white|color=darkblue}}
|-
|-
| {{Tl|good}}, {{Tlp|good|A}} || {{good}} || {{good|A}}
| {{Tlp|won|place{{=}}1}} || {{won|place=1}} || {{Tlp|won|place{{=}}Gold}} || {{won|place=Gold}}
|-
|-
| {{Tlp|won|place{{=}}2}} || {{won|place=2}} || {{Tlp|won|place{{=}}Silver}} || {{won|place=Silver}}
|rowspan=3| <code>table-no2</code> || {{Tl|no2}}<ref name="table-cell-templates-table-after">Does not take a parameter; the content should be placed after the template call.</ref> Text || {{no2}} Text ||
|-
|-
| {{Tl|nom}}, {{Tlp|nom|5}} || {{nom}} || {{nom|5}}
| {{Tlp|won|place{{=}}3}} || {{won|place=3}} || {{Tlp|won|place{{=}}Bronze}} || {{won|place=Bronze}}
|-
|-
| {{Tl|sho}} || {{sho}} ||
|rowspan=4| <code>table-no2</code> || {{Tl|no2}} || {{no2}} || {{Tlp|no2|Text}} || {{no2|Text}}
|-
|-
|rowspan=4| <code>table-partial</code> || {{Tl|partial}} || {{partial}} ||
| {{Tl|nom}} || {{nom}} || {{Tlp|nom|5}} || {{nom|5}}
|-
|-
| {{Tl|yes-No}} || {{Yes-No}} ||
| {{Tl|sho}} || {{sho}} || ||
|-
|-
| {{Tl|okay}}, {{Tlp|okay|C}} || {{okay}} || {{okay|C}}
| {{Tl|TBA}} || {{TBA}} || {{Tlp|TBA|To be announced}} || {{TBA|To be announced}}
|-
|-
|rowspan=4| <code>table-partial</code> || {{Tl|partial}} || {{partial}} || {{tlp|partial|Almost done}} ||{{partial|Almost done}}
| {{Tl|some}} || {{some}} ||
|-
|-
| <code>table-any</code> || {{Tl|any}} || {{any}} ||
| {{Tl|yes-No}} || {{Yes-No}} || ||
|-
|-
|rowspan=2| <code>table-na</code> || {{Tl|n/a}} || {{n/a}} ||
| {{Tl|okay}} || {{okay}} || {{Tlp|okay|C}} || {{okay|C}}
|-
|-
| {{Tl|BLACK}} || {{BLACK}} ||
| {{Tl|some}} || {{some}} || ||
|-
|-
|rowspan=2| <code>table-unknown</code> || {{Tl|dunno}} || {{dunno}} ||
| <code>table-any</code> || {{Tl|any}} || {{any}} || ||
|-
|-
| {{Tl|Unknown}} || {{Unknown}} ||
|rowspan=2| <code>table-na</code> || {{Tl|n/a}} || {{n/a}} || ||
|-
|-
| {{Tl|BLACK}} || {{BLACK}} || ||
| <code>table-depends</code> || {{Tl|Depends}}, {{Tlp|Depends|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{Depends}}|| {{Depends|Alternative [[Plain text|text]]}}
|-
|-
| <code>table-included</code> || {{Tl|Included}} || {{Included}} ||
|rowspan=2| <code>table-unknown</code> || {{Tl|dunno}} || {{dunno}} || {{Tlp|dunno|<nowiki>Custom [[Plain text|text]]</nowiki>}} || {{dunno|Custom [[Plain text|text]]}}
|-
|-
|rowspan=2| <code>table-dropped</code> || {{Tl|dropped}} || {{dropped}} ||
| {{Tl|unknown}} || {{Unknown}} || {{Tlp|unknown|?}} || {{unknown|?}}
|-
|-
| <code>table-depends</code> || {{Tl|depends}} || {{Depends}} || {{Tlp|depends|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{Depends|Customized [[Plain text|text]]}}
| {{Tl|terminated}} || {{terminated}} ||
|-
|-
|rowspan=2| <code>table-beta</code> || {{Tl|beta}} || {{beta}} ||
| <code>table-included</code> || {{Tl|included}} || {{Included}} || ||
|-
|-
|rowspan=2| <code>table-dropped</code> || {{Tl|dropped}} || {{dropped}} || ||
| {{Tl|table-experimental}}, {{Tlp|table-experimental|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{table-experimental}}||{{table-experimental|Alternative [[Plain text|text]]}}
|-
|-
| {{Tl|terminated}} || {{terminated}} || ||
| <code>table-free</code> || {{Tl|free}}, {{Tlp|free|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{free}} ||{{free|Alternative [[Plain text|text]]}}
|-
|-
| <code>table-nonfree</code> || {{Tl|nonfree}}, {{Tlp|nonfree|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{nonfree}}|| {{nonfree|Alternative [[Plain text|text]]}}
|rowspan=2| <code>table-beta</code> || {{Tl|beta}} || {{beta}} || ||
|-
|-
| <code>table-proprietary</code> || {{Tl|proprietary}}, {{Tlp|proprietary|<nowiki>Alternative [[Plain text|text]]</nowiki>}} ||{{proprietary}} || {{proprietary|Alternate [[Plain text|text]]}}
| {{Tl|table-experimental}} || {{table-experimental}} || {{Tlp|table-experimental|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{table-experimental|Customized [[Plain text|text]]}}
|-
|-
| <code>table-needs</code> || {{Tl|needs}}, {{Tlp|needs|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{needs}} ||{{needs|Alternative [[Plain text|text]]}}
| <code>table-maybe</code> || {{Tl|maybe}} || {{maybe}} || {{Tlp|maybe|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{maybe|Customized [[Plain text|text]]}}
|-
|-
| ''no class'' || {{Tl|incorrect}}, {{Tlp|incorrect|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{incorrect}} ||{{incorrect|Alternative [[Plain text|text]]}}
| <code>table-free</code> || {{Tl|free}} || {{free}} || {{Tlp|free|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{free|Customized [[Plain text|text]]}}
|-
|-
| <code>table-proprietary</code> || {{Tl|proprietary}} || {{proprietary}} || {{Tlp|proprietary|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{proprietary|Customized [[Plain text|text]]}}
| ''no class'' || {{Tl|no result}}, {{Tlp|no result|N.R.}} || {{No result}} || {{No result|N.R.}}
|-
|-
| <code>table-nonfree</code> || {{Tl|nonfree}} || {{nonfree}} || {{Tlp|nonfree|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{nonfree|Customized [[Plain text|text]]}}
| ''no class'' || {{Tl|pending}} || {{Pending}} ||
|-
|-
| <code>table-nightly</code> || {{Tl|nightly}}, {{Tlp|nightly|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{nightly}}|| {{nightly|Alternative [[Plain text|text]]}}
| <code>table-needs</code> || {{Tl|needs}} || {{needs}} || {{Tlp|needs|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{needs|Customized [[Plain text|text]]}}
|-
|-
| <code>table-release-candidate</code> || {{Tl|release-candidate}}, {{Tlp|release-candidate|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{release-candidate}}|| {{release-candidate|Alternative [[Plain text|text]]}}
| <code>table-nightly</code> || {{Tl|nightly}} || {{nightly}} || {{Tlp|nightly|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{nightly|Customized [[Plain text|text]]}}
|-
|-
| <code>table-release-candidate</code> || {{Tl|release-candidate}} || {{release-candidate}} || {{Tlp|release-candidate|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{release-candidate|Customized [[Plain text|text]]}}
| ''no class'' || {{Tl|?}}<ref name="table-cell-templates-table-noparam">Does not take a parameter; not really a table cell template at all, but here for completeness</ref> || {{?}} ||
|-
|-
| ''no class'' || {{Tl|unofficial}} || {{Unofficial}} ||
| ''no class'' || {{Tl|draw}} || {{draw}} || {{Tlp|draw|Text}} || {{draw|Text}}
|-
|-
| ''no class'' || {{Tl|usually}} || {{Usually}} ||
| ''no class'' || {{Tl|incorrect}} || {{incorrect}} || {{Tlp|incorrect|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{incorrect|Customized [[Plain text|text]]}}
|-
| ''no class'' || {{Tl|no result}} || {{No result}} || {{Tlp|no result|N.R.}} || {{No result|N.R.}}
|-
| ''no class'' || {{Tl|pending}} || {{Pending}} || ||
|-
| ''no class'' || {{Tl|unofficial}} || {{Unofficial}} || ||
|-
| ''no class'' || {{Tl|usually}} || {{Usually}} || ||
|-
| ''no class'' || {{Tl|rarely}} || {{Rarely}} || ||
|-
| ''no class'' || {{Tl|sometimes}} || {{Sometimes}} || ||
|-
| ''no class'' || {{Tl|CMain}} || {{CMain}} || ||
|-
| ''no class'' || {{Tl|CRecurring}} || {{CRecurring}} || ||
|-
| ''no class'' || {{Tl|CGuest}} || {{CGuest}} || ||
|-
| ''no class'' || {{Tl|active fire|12%}} || {{active fire|12%}} || ||
|-
| ''no class'' || {{Tl|contained}} || {{contained}} || ||
|-
|-
| ''no class'' || {{Tl|rarely}} || {{Rarely}} ||
|}
|}



Revisi per 19 Oktober 2015 11.19

The templates in this series are designed to be used in a table to make a cell with text in that cell, with an appropriately colored background. They are commonly used in comparison tables.

For example, {{yes}} makes a cell with a green background. The text in the cell is taken from the first parameter; {{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:

Ya Tidak
Ya/Tidak
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...

Templates in this series

Table cell templates
Class[1] Default syntax Preview (default) Customized syntax Preview (customized)
table-rh {{rh}} | Row header[2] Row header {{rh|align=right}} | Row header Row header
{{rh2}} | Row header[2] Row header {{rh2|align=right}} | Row header Row header
table-yes {{yes}} Ya {{yes|Customized [[Plain text|text]]}} Customized text
{{ya}} Yes {{ya|Customized alt text|link=WP:ALT}} Customized alt text
table-no {{no}} Tidak {{no|Customized [[Plain text|text]]}} Customized text
{{na}} No {{na|Customized alt text|link=WP:ALT}} Customized alt text
{{coming soon}} Segera
{{bad}} Buruk {{bad|F}} F
{{eliminated}} Tereliminasi
table-siteactive {{site active}} Aktif
table-siteinactive {{site inactive}} Tidak aktif
table-yes2 {{good}} Bagus {{good|A}} A
{{yes2}} {{yes2|Text}} Text
{{won}} Menang {{won|text=white|color=darkblue}} Menang
{{won|place=1}} 1 {{won|place=Gold}} Gold
{{won|place=2}} 2 {{won|place=Silver}} Silver
{{won|place=3}} 3 {{won|place=Bronze}} Bronze
table-no2 {{no2}} {{no2|Text}} Text
{{nom}} Nominasi {{nom|5}} 5
{{sho}} Terpilih
{{TBA}} TBA {{TBA|To be announced}} To be announced
table-partial {{partial}} Setengah {{partial|Almost done}} Almost done
{{yes-No}} Ya/Tidak
{{okay}} Netral {{okay|C}} C
{{some}} Sedikit
table-any {{any}} Apa saja
table-na {{n/a}}
{{BLACK}} N/A
table-unknown {{dunno}} ? {{dunno|Custom [[Plain text|text]]}} Custom text
{{unknown}} Tidak diketahui {{unknown|?}} ?
table-depends {{depends}} Tergantung {{depends|Customized [[Plain text|text]]}} Customized text
table-included {{included}} Dimasukkan
table-dropped {{dropped}} Dibatalkan
{{terminated}} Dihentikan
table-beta {{beta}} Beta
{{table-experimental}} Uji coba {{table-experimental|Customized [[Plain text|text]]}} Customized text
table-maybe {{maybe}} Mungkin {{maybe|Customized [[Plain text|text]]}} Customized text
table-free {{free}} Gratis {{free|Customized [[Plain text|text]]}} Customized text
table-proprietary {{proprietary}} Milik perorangan {{proprietary|Customized [[Plain text|text]]}} Customized text
table-nonfree {{nonfree}} Berbayar {{nonfree|Customized [[Plain text|text]]}} Customized text
table-needs {{needs}} Dibutuhkan {{needs|Customized [[Plain text|text]]}} Customized text
table-nightly {{nightly}} Bentuk akhir {{nightly|Customized [[Plain text|text]]}} Customized text
table-release-candidate {{release-candidate}} Kandidat peluncuran {{release-candidate|Customized [[Plain text|text]]}} Customized text
no class {{draw}} {{draw|Text}} Text
no class {{incorrect}} Salah {{incorrect|Customized [[Plain text|text]]}} Customized text
no class {{no result}} Tidak ada hasil {{no result|N.R.}} N.R.
no class {{pending}} Belum diputuskan
no class {{unofficial}} Tidak resmi
no class {{usually}} Biasanya
no class {{rarely}} Jarang
no class {{sometimes}} Kadang-kadang
no class {{CMain}} Utama
no class {{CRecurring}} Berulang
no class {{CGuest}} Tamu
no class {{active fire}} Aktif (12%)
no class {{contained}} Dipadamkan

Code

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

style="background: #abcdef; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}" class="automatic table-automatic"| {{{1|text}}}

Code specific to this template:

style="background: white; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}" class="Table cell templates table-Table cell templates"| {{{1|{{{text}}}}}}

To make a new table cell template you can use:

{{subst:Table cell templates| text = default text | bg = background color | class = a class name without prefix | align = standard horizontal alignment}}

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

See also

Notes

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