模板:N/A

出自NeuroWiki
跳至導覽 跳至搜尋
不適用
[ 檢視 | 編輯 | 歷史 | 更新快取 ]文檔頁面

本系列中的模板用於在表格中創建一個含有文本以及適當的背景顏色的單元格。

它們通常用於比較表中。

例如,{{yes}}將產生一個綠色背景的單元格。單元格中的文本取自第一個參數。例如,{{yes|Sure}}將輸出「Sure」;在未指定第一參數值的情況下,{{yes}}將輸出默認值:「是」。大多數模板允許編者以這種方式覆蓋默認文本,有些模板需要在調用後放置文本({{table cell template}} 文本),有些模板還需要在兩者之間使用豎線({{table cell template}} | 文本)。下表中提供了關於顏色和默認文本的信息。

如果您想對表格單元格使用其他屬性,例如colspanrowspan,則需要將它們放在被調用的模板之前,並且與被調用的模板之間不能有豎線|,例如:

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

模板

Table cell templates
屬性[1] 默認語法 預覽(默認) 自定義語法 預覽(自定義)
table-rh {{rh}} | 行標題[2] Template:Rh | Row header {{rh|align=right}} | 行標題 Template:Rh | 行標題
{{rh2}} | 行標題[2] Template:Rh2 | 行標題 {{rh2|align=right}} | 行標題 Template:Rh2 | 行標題
table-yes {{yes}} {{yes|自訂 [[純文字|文字]]}} 自訂 文字
table-maybe {{maybe}} Template:Maybe {{maybe|自訂 [[純文字|文字]]}} Template:Maybe
table-no {{no}} {{no|自訂 [[純文字|文字]]}} 自訂 文字
{{eliminated}} Template:Eliminated {{eliminated|出局}} Template:Eliminated
{{active fire|12%}} Template:Active fire
{{lost}} Template:Lost {{lost|失敗}} Template:Lost
{{safe}} Template:Safe {{safe|被保護}} Template:Safe
table-active {{active}} Template:Active {{active|活躍中}} Template:Active
table-siteactive {{site active}} Template:Site active {{site active|Up}} Template:Site active
{{coming soon}} Template:Coming soon {{coming soon|半年內}} Template:Coming soon
table-siteinactive {{site inactive}} Template:Site inactive {{site inactive|Down}} Template:Site inactive
table-yes2 {{good}} {{good}} {{good|A}} {{good|A}}
{{yes2}} Template:Yes2 {{yes2|Text}} Template:Yes2
{{ya}} Template:Ya {{ya|text=Ya}} Template:Ya
{{ya|Ya}} Template:Ya {{ya|text|link=WP:ALT}} Template:Ya
{{won}} Template:Won {{won|text=white|color=darkblue}} Template:Won
{{won|place=1}} Template:Won {{won|place=Gold}} Template:Won
{{won|place=2}} Template:Won {{won|place=Silver}} Template:Won
{{won|place=3}} Template:Won {{won|place=Bronze}} Template:Won
table-no2 {{no2}} Template:No2 {{no2|Text}} Template:No2
{{na}} Template:Na {{na|text=Na}} Template:Na
{{na|Na}} Template:Na {{na|text|link=WP:ALT}} Template:Na
{{nom}} Template:Nom {{nom|5}} Template:Nom
{{sho}} Template:Sho {{sho|Proposed}} Template:Sho
{{longlisted}} Template:Longlisted {{longlisted|Rejected}} Template:Longlisted
{{TBA}} Template:TBA {{TBA|To be announced}} Template:TBA
table-success {{success}} Template:Success {{success|Mission complete}} Template:Success
{{operational}} Template:Operational {{operational|Returning data}} Template:Operational
table-failure {{failure}} Template:Failure {{failure|Wrong orbit}} Template:Failure
table-partial {{partial}} Template:Partial {{partial|Almost done}} Template:Partial
{{Regional}} Template:Regional {{Regional|Uyghur}} Template:Regional
{{MaybeCheck}} Template:MaybeCheck {{MaybeCheck|text=Possibly}} Template:MaybeCheck
{{MaybeCheck|Possibly}} Template:MaybeCheck {{MaybeCheck|text|link=WP:ALT}} Template:MaybeCheck
{{MaybeQuestion}} Template:MaybeQuestion {{MaybeQuestion|text=Possibly?}} Template:MaybeQuestion
{{partial success}} Template:Partial success {{partial success|Reached orbit and returned pictures}} Template:Partial success
{{partial failure}} Template:Partial failure {{partial failure|[[Cubesat]] not deployed}} Template:Partial failure
{{okay}} Template:Okay {{okay|C}} Template:Okay
{{Yes-No}} 是/否 {{Yes-No|Yes with an if; no with a but}} Yes with an if; no with a but
{{some}} Template:Some {{some|Many}} Template:Some
{{nonpartisan}} Template:Nonpartisan {{nonpartisan|Impartial}} Template:Nonpartisan
{{pending}} Template:Pending {{pending|Awaiting}} Template:Pending
{{unofficial}} Template:Unofficial {{unofficial|''De facto''}} Template:Unofficial
{{unofficial2}} Template:Unofficial2 {{unofficial2|''De facto''}} Template:Unofficial2
{{usually}} Template:Usually {{usually|Commonly}} Template:Usually
{{rarely}} Template:Rarely {{rarely|Seldom}} Template:Rarely
{{sometimes}} Template:Sometimes {{sometimes|Occasionally}} Template:Sometimes
table-any {{any}} Template:Any {{any|Anyone}} Template:Any
table-na {{n/a}} 不適用 {{n/a|Unavailable}} Unavailable
{{varies}} Template:Varies {{varies|Differs}} Template:Varies
{{sdash}} Template:Sdash {{sdash|[[File:Dash.svg|13px|link=|dash icon]]}} Template:Sdash
{{BLACK}} Template:BLACK {{BLACK|Banned}} Template:BLACK
{{non-album single}} Template:Non-album single {{non-album single|自訂 [[純文字|文字]]}} Template:Non-album single
{{unreleased}} Template:Unreleased {{unreleased|自訂 [[純文字|文字]]}} Template:Unreleased
table-unknown {{unknown}} Template:Unknown {{unknown|?}} Template:Unknown
{{dunno}} Template:Dunno {{dunno|Not sure}} Template:Dunno
table-automatic {{perhaps}} Template:Perhaps {{perhaps|自訂 [[純文字|文字]]}} Template:Perhaps
table-depends {{depends}} Template:Depends {{depends|自訂 [[純文字|文字]]}} Template:Depends
table-included {{included}} Template:Included {{included|Incorporated}} Template:Included
table-dropped {{dropped}} Template:Dropped {{dropped|Discontinued}} Template:Dropped
{{terminated}} Template:Terminated {{terminated|Fired}} Template:Terminated
table-beta {{beta}} Template:Beta {{beta|Preview}} Template:Beta
table-experimental {{table-experimental}} Template:Table-experimental {{table-experimental|自訂 [[純文字|文字]]}} Template:Table-experimental
table-free {{free}} Template:Free {{free|自訂 [[純文字|文字]]}} Template:Free
table-proprietary {{proprietary}} Template:Proprietary {{proprietary|自訂 [[純文字|文字]]}} Template:Proprietary
table-nonfree {{nonfree}} Template:Nonfree {{nonfree|自訂 [[純文字|文字]]}} Template:Nonfree
table-needs {{needs}} Template:Needs {{needs|自訂 [[純文字|文字]]}} Template:Needs
table-nightly {{nightly}} Template:Nightly {{nightly|自訂 [[純文字|文字]]}} Template:Nightly
table-release-candidate {{release-candidate}} Template:Release-candidate {{release-candidate|自訂 [[純文字|文字]]}} Template:Release-candidate
table-draw {{draw}} Template:Draw {{draw|Text}} Template:Draw
table-planned {{planned}} Template:Planned {{planned|July 2018}} Template:Planned
table-scheduled {{scheduled}} Template:Scheduled {{scheduled|3 March 2017}} Template:Scheduled
incorrect {{incorrect}} Template:Incorrect {{incorrect|自訂 [[純文字|文字]]}} Template:Incorrect
noresult {{no result}} Template:No result {{no result|N.R.}} Template:No result
no class {{CMain}} Template:CMain {{CMain|自訂 [[純文字|文字]]}} Template:CMain
{{CAlso starring}} Template:CAlso starring {{CAlso starring|自訂 [[純文字|文字]]}} Template:CAlso starring
{{CRecurring}} Template:CRecurring {{CRecurring|自訂 [[純文字|文字]]}} Template:CRecurring
{{CGuest}} Template:CGuest {{CGuest|自訂 [[純文字|文字]]}} Template:CGuest
{{CNone}} Template:CNone {{CNone|自訂 [[純文字|文字]]}} Template:CNone
{{nocontest}} Template:Nocontest {{nocontest|自訂 [[純文字|文字]]}} Template:Nocontest自訂 文字
{{not yet}} Template:Not yet {{not yet|自訂 [[純文字|文字]]}} Template:Not yet
{{optional}} Template:Optional {{optional|自訂 [[純文字|文字]]}} Template:Optional

Code

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

Template:Table cell templates

Code specific to this template:

Template:N

To make a new table cell template you can use: <syntaxhighlight lang=text inline>{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}</syntaxhighlight>

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

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

TemplateData

Template:TemplateDataHeader

One of several templates for styling individual table cells with standard contents and colors.

模板參數

參數描述類型狀態
text1

text to be displayed instead of the default, if this doesn't work put the text after the template, possibly with a vertical bar | in between

預設
(template dependent)
非必填
horizontal alignalign

text alignment inside the cell, either 'left', 'right', 'center' or 'justified'

預設
center
非必填
stylestyle

a semicolon separated list of additional CSS rules to be applied to the table cell

預設
非必填
background colorcolor

a valid CSS color value or name to override the standard the cell background, only available with some templates

預設
(template dependent)
非必填

See also

Notes

Template:Reflist

[ 檢視 | 編輯 | 歷史 | 更新快取 ]上述文檔引用自Template:N/A/doc
  1. 可以在用戶樣式表中引用表格單元格模板的HTML屬性以更改外觀。
  2. 2.0 2.1 不帶參數; 內容應放置在被調用的模板之後,並以豎線(|)字符分隔。