曾工致力于各类电子电器产品的国际国内认证、EMC整改,欢迎各位询价,提供专业服务,解决客户痛点!专治各种产品不合格!
电话:139 2899 3907 邮箱:info@emc.wiki
模板:Table cell templates
模板:Documentation subpage 模板:Translating
本系列中的模板用于在表格中创建一个含有文本以及适当的背景颜色的单元格。
它们通常用于比较表中。
例如,模板: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 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
- 默认值
- (template dependent)
单行文本 可选 horizontal align align
text alignment inside the cell, either 'left', 'right', 'center' or 'justified'
- 默认值
- center
单行文本 可选 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
- 默认值
- (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 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
- 默认值
- (template dependent)
单行文本 可选 horizontal align align
text alignment inside the cell, either 'left', 'right', 'center' or 'justified'
- 默认值
- center
单行文本 可选 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
- 默认值
- (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