深耕EMC实践,严谨对标国际标准,构建中文电磁兼容与国际认证开放知识库 —— 让技术沉淀,让分享增值!
模板:Table cell templates:修订间差异
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
例如,{{Tlx|yes}}将产生一个绿色背景的单元格。单元格中的文本取自[[Help:模板|第一个参数]]。例如,{{tlx|yes|Sure}}将输出“Sure”;在未指定第一参数值的情况下,{{Tlx|yes}}将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本(<code><nowiki>{{</nowiki>''table cell template''}} ''文本''</code>),有些模板还需要在两者之间使用竖线(<code><nowiki>{{</nowiki>''table cell template''}} | ''文本''</code>)。下表中提供了关于颜色和默认文本的信息。 | 例如,{{Tlx|yes}}将产生一个绿色背景的单元格。单元格中的文本取自[[Help:模板|第一个参数]]。例如,{{tlx|yes|Sure}}将输出“Sure”;在未指定第一参数值的情况下,{{Tlx|yes}}将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本(<code><nowiki>{{</nowiki>''table cell template''}} ''文本''</code>),有些模板还需要在两者之间使用竖线(<code><nowiki>{{</nowiki>''table cell template''}} | ''文本''</code>)。下表中提供了关于颜色和默认文本的信息。 | ||
2020年8月2日 (日) 20:57的版本
例如,模板:Tlx将产生一个绿色背景的单元格。单元格中的文本取自第一个参数。例如,模板:Tlx将输出“Sure”;在未指定第一参数值的情况下,模板:Tlx将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本({{table cell template}} 文本),有些模板还需要在两者之间使用竖线({{table cell template}} | 文本)。下表中提供了关于颜色和默认文本的信息。
如果您想对表格单元格使用其他属性,例如colspan或rowspan,则需要将它们放在被调用的模板之前,并且与被调用的模板之间不能有竖线|,例如:
| 是 | 否 | rowspan=2 模板:N/a |
|---|---|---|
| colspan=2 模板:Yes-No |
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...
模板
Code
Common code to most if not all the templates in this series:
例如,模板:Tlx将产生一个绿色背景的单元格。单元格中的文本取自第一个参数。例如,模板:Tlx将输出“Sure”;在未指定第一参数值的情况下,模板:Tlx将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本({{table cell template}} 文本),有些模板还需要在两者之间使用竖线({{table cell template}} | 文本)。下表中提供了关于颜色和默认文本的信息。
如果您想对表格单元格使用其他属性,例如colspan或rowspan,则需要将它们放在被调用的模板之前,并且与被调用的模板之间不能有竖线|,例如:
是
否
rowspan=2 模板:N/a
colspan=2 模板:Yes-No
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...
模板
Code
Common code to most if not all the templates in this series:
检测到模板循环:模板:Table cell templates
Code specific to this template:
检测到模板循环:模板:Table cell templates
To make a new table cell template you can use:
<syntaxhighlight lang=text enclose="div">{{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
One of several templates for styling individual table cells with standard contents and colors.
模板参数
参数 描述 类型 状态 text 1text 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 align aligntext alignment inside the cell, either 'left', 'right', 'center' or 'justified'
- 默认值
- center
单行文本 可选 style stylea semicolon separated list of additional CSS rules to be applied to the table cell
- 默认值
单行文本 可选 background color colora valid CSS color value or name to override the standard the cell background, only available with some templates
- 默认值
- (template dependent)
单行文本 可选
See also
Notes
Code specific to this template:
例如,模板:Tlx将产生一个绿色背景的单元格。单元格中的文本取自第一个参数。例如,模板:Tlx将输出“Sure”;在未指定第一参数值的情况下,模板:Tlx将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本({{table cell template}} 文本),有些模板还需要在两者之间使用竖线({{table cell template}} | 文本)。下表中提供了关于颜色和默认文本的信息。
如果您想对表格单元格使用其他属性,例如colspan或rowspan,则需要将它们放在被调用的模板之前,并且与被调用的模板之间不能有竖线|,例如:
是
否
rowspan=2 模板:N/a
colspan=2 模板:Yes-No
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...
模板
Code
Common code to most if not all the templates in this series:
检测到模板循环:模板:Table cell templates
Code specific to this template:
检测到模板循环:模板:Table cell templates
To make a new table cell template you can use:
<syntaxhighlight lang=text enclose="div">{{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
One of several templates for styling individual table cells with standard contents and colors.
模板参数
参数 描述 类型 状态 text 1text 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 align aligntext alignment inside the cell, either 'left', 'right', 'center' or 'justified'
- 默认值
- center
单行文本 可选 style stylea semicolon separated list of additional CSS rules to be applied to the table cell
- 默认值
单行文本 可选 background color colora valid CSS color value or name to override the standard the cell background, only available with some templates
- 默认值
- (template dependent)
单行文本 可选
See also
Notes
To make a new table cell template you can use: <syntaxhighlight lang=text enclose="div">{{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
One of several templates for styling individual table cells with standard contents and colors.
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| text | 1 | 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
| 单行文本 | 可选 |
| horizontal align | align | text alignment inside the cell, either 'left', 'right', 'center' or 'justified'
| 单行文本 | 可选 |
| style | style | a semicolon separated list of additional CSS rules to be applied to the table cell
| 单行文本 | 可选 |
| background color | color | a valid CSS color value or name to override the standard the cell background, only available with some templates
| 单行文本 | 可选 |
See also
- 模板:Tl – calculates, displays and color-codes changes between two values
- 模板:Tl – specialized redirect for 模板:Tlf
- 模板:Tl – specialized redirect for 模板:Tlf
- 模板:Tl – specialized redirect for 模板:Tlf
Notes
