模板:Yes-No

来自能源智库
跳转至: 导航搜索
是/否
50px 模板-{zh-hans:文档; zh-hant:文件;}-[-{zh-hans:查看; zh-hant:檢視;}-] [编辑] [-{zh-hans:页面历史; zh-hant:頁面歷史; zh-cn:页面历史; zh-sg:页面历史; zh-hk:頁面歷史; zh-mo:頁面歷史; zh-tw:修訂記錄;}-] [清除]

本系列的模板是專門為在條目內容中使用表格而設計,使儲存格內可加入文字,並配以合適的顏色背景。這些模板通常在比較表格中使用。

例如:{{yes}}這個模版可令一個儲存格變成綠色背景,並寫上“是”這個字。格中的文字来自第一个参数;如果改成{{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:

1 0 不適用
是/否
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...

Templates in this series

Table cell templates
Class[1] Template Preview Preview, alternative
table-rh {{rh}} | Row header 模板:Rh | Row header
{{rh2}}[2] | Row header 模板:Rh2 | Row header
table-yes {{yes}}, 模板:Tlp 1 1Alternative text
table-no {{no}}, 模板:Tlp 0 0Alternative text
{{coming soon}} 模板:Coming soon
{{bad}}, 模板:Tlp 模板:Bad 模板:Bad
table-siteactive {{Site active}} 模板:Site active
table-siteinactive {{Site inactive}} 模板:Site inactive
table-yes2 {{yes2}}[3] Text Text
{{won}}, 模板:Tlp 模板:Won 模板:Won
{{won|place=1}} or =Gold 模板:Won
{{won|place=2}} or =Silver 模板:Won
{{won|place=3}} or =Bronze 模板:Won
{{won|text=white|color=blue}} or =#1122CC 模板:Won
table-no2 {{no2}}[3] Text 模板:No2 Text
{{nom}}, 模板:Tlp 模板:Nom 模板:Nom
{{sho}} 模板:Sho
table-partial {{partial}} 模板:Partial
{{yes-No}} 是/否
{{okay}}, 模板:Tlp 模板:Okay 模板:Okay
{{some}} 模板:Some
table-any {{any}} 模板:Any
table-na {{n/a}} 不適用
{{BLACK}} 模板:BLACK
table-unknown {{dunno}} 模板:Dunno
table-depends {{Depends}}, 模板:Tlp 模板:Depends 模板:Depends
table-included {{Included}} 模板:Included
table-dropped {{dropped}} 模板:Dropped
{{terminated}} 模板:Terminated
table-beta {{beta}} 模板:Beta
{{table-experimental}}, 模板:Tlp 模板:Table-experimental 模板:Table-experimental
table-free {{free}}, 模板:Tlp 模板:Free 模板:Free
table-nonfree {{nonfree}}, 模板:Tlp 模板:Nonfree 模板:Nonfree
table-proprietary {{proprietary}}, 模板:Tlp 模板:Proprietary 模板:Proprietary
table-needs {{needs}}, 模板:Tlp 模板:Needs 模板:Needs
no class {{incorrect}}, 模板:Tlp 模板:Incorrect 模板:Incorrect
no class {{no result}}, 模板:Tlp 模板:No result 模板:No result
no class {{pending}} 模板:Pending
table-nightly {{nightly}}, 模板:Tlp 模板:Nightly 模板:Nightly
table-release-candidate {{release-candidate}}, 模板:Tlp 模板:Release-candidate 模板:Release-candidate
no class {{?}}[4] 模板:?
no class {{unofficial}} 模板:Unofficial
no class {{usually}} 模板:Usually
no class {{rarely}} 模板:Rarely

編碼內容

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: #FFD; color: black; vertical-align: middle; text-align: center; " class="partial table-partial"|是/否

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

參看

注意事項

模板:Reflist

  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.
  3. 3.0 3.1 Does not take a parameter; the content should be placed after the template call.
  4. Does not take a parameter; not really a table cell template at all, but here for completeness