Templat:Table cell templates/doc: Perbedaan antara revisi
k bot Membuang: es:Plantilla:Celda de tabla de plantillas (deleted) |
|||
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> !! |
! 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}} |
|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}} |
|rowspan=2| <code>table-yes</code> || {{Tl|yes}} || {{yes}} || {{Tlp|yes|<nowiki>Customized [[Plain text|text]]</nowiki>}} ||{{yes|Customized [[Plain text|text]]}} |
||
|- |
|- |
||
| {{tl|ya}} || {{Ya}} || {{tlp|ya|Customized alt text|link{{=}}WP:ALT}} || {{Ya|Customized alt text|link=WP:ALT}} |
|||
|- |
|- |
||
⚫ | |||
⚫ | |||
|- |
|- |
||
| {{ |
| {{tl|na}} || {{Na}} || {{tlp|na|Customized alt text|link{{=}}WP:ALT}} || {{Na|Customized alt text|link=WP:ALT}} |
||
|- |
|- |
||
| {{Tl|coming soon}} || {{coming soon}} || || |
|||
|- |
|- |
||
| |
| {{Tl|bad}} || {{bad}} || {{Tlp|bad|F}} || {{bad|F}} |
||
|- |
|- |
||
⚫ | |||
⚫ | |||
|- |
|- |
||
| {{Tl| |
| <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}} || |
|||
|- |
|- |
||
| < |
|rowspan=6| <code>table-yes2</code> || {{Tl|good}} || {{good}} || {{Tlp|good|A}} || {{good|A}} |
||
|- |
|- |
||
| |
| {{Tl|yes2}} || {{yes2}} || {{Tlp|yes2|Text}} || {{yes2|Text}} |
||
|- |
|- |
||
| |
| {{Tl|won}} || {{won}} || {{Tlp|won|text{{=}}white|color{{=}}darkblue}} || {{won|text=white|color=darkblue}} |
||
|- |
|- |
||
| {{ |
| {{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 || |
|||
|- |
|- |
||
| {{ |
| {{Tlp|won|place{{=}}3}} || {{won|place=3}} || {{Tlp|won|place{{=}}Bronze}} || {{won|place=Bronze}} |
||
|- |
|- |
||
| {{Tl| |
|rowspan=4| <code>table-no2</code> || {{Tl|no2}} || {{no2}} || {{Tlp|no2|Text}} || {{no2|Text}} |
||
|- |
|- |
||
| {{Tl|nom}} || {{nom}} || {{Tlp|nom|5}} || {{nom|5}} |
|||
|- |
|- |
||
| {{Tl| |
| {{Tl|sho}} || {{sho}} || || |
||
|- |
|- |
||
| {{Tl| |
| {{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|yes-No}} || {{Yes-No}} || || |
|||
|- |
|- |
||
| {{Tl|okay}} || {{okay}} || {{Tlp|okay|C}} || {{okay|C}} |
|||
|- |
|- |
||
| {{Tl| |
| {{Tl|some}} || {{some}} || || |
||
|- |
|- |
||
| <code>table-any</code> || {{Tl|any}} || {{any}} || || |
|||
|- |
|- |
||
| {{Tl| |
|rowspan=2| <code>table-na</code> || {{Tl|n/a}} || {{n/a}} || || |
||
|- |
|- |
||
⚫ | |||
⚫ | |||
|- |
|- |
||
| <code>table- |
|rowspan=2| <code>table-unknown</code> || {{Tl|dunno}} || {{dunno}} || {{Tlp|dunno|<nowiki>Custom [[Plain text|text]]</nowiki>}} || {{dunno|Custom [[Plain text|text]]}} |
||
|- |
|- |
||
| {{Tl|unknown}} || {{Unknown}} || {{Tlp|unknown|?}} || {{unknown|?}} |
|||
|- |
|- |
||
⚫ | |||
⚫ | |||
|- |
|- |
||
| <code>table-included</code> || {{Tl|included}} || {{Included}} || || |
|||
|- |
|- |
||
⚫ | |||
| {{Tl|table-experimental}}, {{Tlp|table-experimental|<nowiki>Alternative [[Plain text|text]]</nowiki>}} || {{table-experimental}}||{{table-experimental|Alternative [[Plain text|text]]}} |
|||
|- |
|- |
||
⚫ | |||
⚫ | |||
|- |
|- |
||
| <code>table- |
|rowspan=2| <code>table-beta</code> || {{Tl|beta}} || {{beta}} || || |
||
|- |
|- |
||
| |
| {{Tl|table-experimental}} || {{table-experimental}} || {{Tlp|table-experimental|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{table-experimental|Customized [[Plain text|text]]}} |
||
|- |
|- |
||
| <code>table- |
| <code>table-maybe</code> || {{Tl|maybe}} || {{maybe}} || {{Tlp|maybe|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{maybe|Customized [[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]]}} |
|||
⚫ | |||
|- |
|- |
||
| <code>table-nonfree</code> || {{Tl|nonfree}} || {{nonfree}} || {{Tlp|nonfree|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{nonfree|Customized [[Plain text|text]]}} |
|||
⚫ | |||
|- |
|- |
||
| <code>table- |
| <code>table-needs</code> || {{Tl|needs}} || {{needs}} || {{Tlp|needs|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{needs|Customized [[Plain text|text]]}} |
||
|- |
|- |
||
| <code>table- |
| <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| |
| ''no class'' || {{Tl|draw}} || {{draw}} || {{Tlp|draw|Text}} || {{draw|Text}} |
||
|- |
|- |
||
| ''no class'' || {{Tl| |
| ''no class'' || {{Tl|incorrect}} || {{incorrect}} || {{Tlp|incorrect|<nowiki>Customized [[Plain text|text]]</nowiki>}} || {{incorrect|Customized [[Plain text|text]]}} |
||
|- |
|||
⚫ | |||
|- |
|||
⚫ | |||
|- |
|||
⚫ | |||
|- |
|||
| ''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}} || || |
|||
|- |
|- |
||
⚫ | |||
|} |
|} |
||
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
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}} | {{ya|Customized alt text|link=WP:ALT}} | |||
table-no |
{{no}} | Tidak | {{no|Customized [[Plain text|text]]}} | Customized text |
{{na}} | {{na|Customized alt text|link=WP:ALT}} | |||
{{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
- {{multiplayer}}
- {{GPL-lic}}
- {{chg}}: calculate and display changes between two values
Notes
- ^ The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
- ^ a b Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.