模板:TBA
| 待公布 |
页面Module:Documentation/styles.css没有内容。
本系列中的模板用于在表格中创建一个含有文本以及适当的背景颜色的单元格。
它们通常用于比较表中。
例如,Template:Tlx将产生一个绿色背景的单元格。单元格中的文本取自第一个参数。例如,Template:Tlx将输出“Sure”;在未指定第一参数值的情况下,Template:Tlx将输出默认值:“是”。大多数模板允许编者以这种方式覆盖默认文本,有些模板需要在调用后放置文本({{table cell template}} 文本),有些模板还需要在两者之间使用竖线({{table cell template}} | 文本)。下表中提供了关于颜色和默认文本的信息。
File:Nuvola apps important.svg 重要提醒:如果您想对表格单元格使用其他属性,例如colspan或rowspan,则需要将它们放在被调用的模板之前,并且与被调用的模板之间不能有竖线|,例如:
| 是 | 否 | 不适用 |
|---|---|---|
| 是/否 | ||
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 style="border:solid 3px Maroon" {{Yes-No}}
...
模板[编辑]
源代码[编辑]
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 skin-invert"| {{{1|text}}}
Code specific to this template:
data-sort-value="" style="background: #DDF; color:black; vertical-align: middle; text-align: center; " class="skin-invert no table-no2" data-temp="TBA" | 待公布
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}}}.
style="background: #abcdef; color: black; vertical-align: middle; text-align: center; " class="automatic table-automatic"| text
模板资料[编辑]
<templatedata>{ "description": "One of several templates for styling individual table cells with standard contents and colors.", "params": { "1": {
"label": "text", "description": "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", "type": "string/line", "default": "(template dependent)", "required": false
}, "align": {
"label": "horizontal align", "description": "text alignment inside the cell, either 'left', 'right', 'center' or 'justified'", "default": "center", "inherits": "1"
}, "style": {
"label": "style", "description": "a semicolon separated list of additional CSS rules to be applied to the table cell", "default": "", "inherits": "1"
}, "color": {
"label": "background color", "description": "a valid CSS color value or name to override the standard the cell background, only available with some templates", "inherits": "1"
} }}</templatedata>
参见[编辑]
- {{Change}} – calculates, displays and color-codes changes between two values
- {{BSD-lic}} – specialized redirect for 脚本错误:没有“Tlg”这个模块。
- {{GPL-lic}} – specialized redirect for 脚本错误:没有“Tlg”这个模块。
- {{LGPL-lic}} – specialized redirect for 脚本错误:没有“Tlg”这个模块。
注释[编辑]
- ↑ 可以在用户样式表中引用表格单元格模板的HTML属性以更改外观。
- ↑ 2.0 2.1 Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
- ↑ 该模板在英文维基百科与Template:WikiProject link相关(中文维基百科无此专题)。
- ↑ 该模板与Template:WikiProject link相关
- ↑ 该模板与Template:WikiProject link相关。
- ↑ 该模板与Template:WikiProject link相关。