打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

目前wiki关闭了自行注册账号的功能,如需注册账号,请查阅Help:注册账号

模板:Infobox/doc:修订间差异

来自RIA | Wiki
Aunst留言 | 贡献
测试
Aunst留言 | 贡献
修正模板数据
 
(未显示同一用户的6个中间版本)
第1行: 第1行:
<noinclude>
{{From_Wikipedia}}
本模板为一系列 "信息框" 板的元模板, 即本模板用于构建其他模板。通常不建议在条目中直接使用此模板, 但是如有需要, 可以在个别 "一次性" 情况中直接使用。


本模板使用 [[mw:Extension:TemplateStyles]] 来载入样式表, 查看样式表文件请前往 [[Module:Infobox/styles.css]]
{{tlf|Infobox}}是构建信息框的元模板,它用来构建一个像<nowiki>{{Infobox 一些主题}}</nowiki>的模板,比如{{tl|Infobox_settlement}}。
 
此模板是信息框的元模板:它用来构建其他信息框模板。'''注意''':此模板通常不应直接在条目中使用,但若需要,可在一次性情况中直接使用。[[wikipedia:Help:Infobox]]中包含关于信息框内容和设计的介绍。[[wikipedia:Wikipedia:Manual_of_Styles/Infoboxes]]中包含附加格式指南。参见[[:Category:信息框模板]]查看已有的信息框模板。


== 使用 ==
== 使用 ==
{{tl|Infobox}} 是一个元模板: 用于构建一个像 <code><nowiki>{{Infobox </nowiki>''一些主题''<nowiki>}}</nowiki></code> 的模板 (像 {{tl|Infobox_settlement_Minecraft}}).
对于{{tnull|Infobox 一些主题}},经过简化的模板代码看起像这样:
 
对于 <code><nowiki>[[Template:Infobox 一些主题]]</nowiki></code>, 模板代码看起来像这样 (经过简化) :
<pre>
<pre>
{{Infobox
{{Infobox
   | name    = {{{name|{{PAGENAME}}}}}
   | name    = {{{name|{{PAGENAME}}}}}
   | image    = {{{image|}}}
   | image    = {{{image|}}}
   | caption1 = {{{caption|}}}}}}
   | caption1 = {{{caption|}}}


   | label1  = Former names
   | label1  = 前名
   |  data1  = {{{former_names|}}}
   |  data1  = {{{former_names|}}}


   | header2  = General information
   | header2  = 一般信息


   | label3  = Status
   | label3  = 状态
   |  data3  = {{{status|}}}
   |  data3  = {{{status|}}}
   ... <!-- etc. -->
   ... <!-- etc. -->
第25行: 第24行:
</pre>
</pre>


== 可选的控制参数 ==
== 参数 ==
=== 可选控制参数 ===
; name
; name
: 如果此参数被定义, 指向该模板指定的页面的 "V&bull;T&bull;E" 链接将添加到信息框的底部, 您可以使用值<code><nowiki>{{subst:PAGENAME}}</nowiki></code>;
: 如果此参数存在,“查看·编辑·讨论”链接显示在信息框底部,链接指向此参数指定的页面。如果未在此参数中指定命名空间,则在链接前添加“<code>Template:</code>”(模板)前缀。可使用<nowiki>{{subst:PAGENAME}}</nowiki>;但这不太可能是你希望的,因为点击链接的用户会被导向模板页面/代码,而不是他们可能希望更改的条目中的信息框数据。
; child 和 subbox
; child
: [[#嵌入]]
: 详细信息参见[[#嵌入|嵌入]]一节。如果此参数设置为“yes”,这个子信息框应该含有标题,不含name参数。此参数默认为空。
; subbox
: 详细信息参见[[#子盒|子盒]]一节。如果此参数设置为“yes”,这个子信息框应该含有标题,不含name参数。此参数默认为空。
; decat
; decat
: 如果将此设置为 "yes" , 则当生成的信息框有一些问题或没有可见数据部分时, 当前页面将不会自动分类到维护类别中。默认为空, 设置为 "yes" 来激活它。
: 如果此参数设置为“yes”,生成的信息框有问题,或不含有可见数据时,当前页面将不会被自动分类进维护分类中。此参数默认为空。
; autoheaders
: 如果此参数设置为任意非空值,则后面没有data字段的header会被隐藏。详细信息参见“[[#在下方所有数据字段都为空时隐藏顶栏|在下方所有数据字段都为空时隐藏顶栏]]”一节。


== 内容参数 ==
=== 内容参数 ===
=== 标题 ===
==== 标题 ====
有两种不同的方式在 Infobox 内显示标题. 一种是在信息框内的最上方包含标题, 另一种是作为标题放在信息框外的顶部。如果愿意, 可以将它们一起使用, 也可以只使用其中之一, 甚至都不用 (尽管不建议这样做) :
有两种不同的在信息框中放置标题的方法。一种会将标题放置在信息框表格内最上面的单元格,另一种放置在表格上方。你可以同时使用这两种方法,或只使用其中一种,或者——尽管不推荐——都不用:


; title  
; title
: 在信息框外部的标题文本 [或作为此表的所有内容信息之前的节标题 (如果这是子信息框) ] . 出于可访问性的原因, 这是最推荐的选择.
: 放置在表格上方的标题文本(如果这是个子信息框,则作为整个表格内容的区域标题)
; above
; above
: 在信息框内的最上方的标题文本.
: 放置在表格内最上面单元格的文本。
; subheader(n)
; subheader<var>n</var>
: 附加标题文本 (子标题), 在 {{para|title}} 和 {{para|above}} 的下方, 但在图片的上方.
: 附加标题字段,显示在title和above之下,图像之上。


例子:
示例:
<pre>
{{Infobox
{{Infobox
   | name = Infobox/doc
   | name = Infobox/doc
   | title     = 信息框上方的文本
   | title = 信息框上方的标题
   | subheader = 信息框的子标题
   | subheader = 信息框的子标题
   | header = (信息框的其余部分放在这里)
   | header = (信息框的其他部分)
}}
}}
<pre>  
</pre>
{{Infobox
{{Infobox
   | name = {{subst:PAGENAME}}
   | name = Infobox/doc
   | title     = 信息框上方的文本
   | title = 信息框上方的标题
   | subheader = 信息框的子标题
   | subheader = 信息框的子标题
   | header = (信息框的其余部分放在这里)
   | header = (信息框的其他部分)
}}
}}
</pre>
{{Clear}}


<pre>
{{Infobox
{{Infobox
   | name = Infobox/doc
   | name = Infobox/doc
   | above     = 信息框最上方单元格的文本
   | above = 信息框内最上方单元格的文本
   | subheader = 信息框的子标题
   | subheader = 信息框的子标题
   | subheader2 = 信息框的第二个子标题
   | subheader2 = 信息框第2个子标题
   | header = (信息框的其余部分放在这里)
   | header = (信息框的其他部分)
}}
}}
<pre>
</pre>
{{Infobox
{{Infobox
   | name = {{subst:PAGENAME}}
   | name = Infobox/doc
   | above      = 信息框最上方单元格的文本
   | title = 信息框内最上方单元格的文本
   | subheader = 信息框的子标题
   | subheader = 信息框的子标题
   | subheader2 = 信息框的第二个子标题
   | subheader2 = 信息框第2个子标题
   | header = (信息框的其余部分放在这里)
   | header = (信息框的其他部分)
}}
}}
{{Clear}}
==== 插图 ====
; image<var>n</var>
: 显示在模板顶部的图像。使用完整图像语法,例如<code><nowiki>[[File:Example.png|200px|alt=示例替代文本]]</nowiki></code>。图像默认居中。参见[[wikipedia:WP:ALT]]获取关于替代文本的更多信息。
; caption<var>n</var>
: 图像下面的描述文本。
==== 主要数据 ====
; header<var>n</var> : 在第<var>n</var>行作为顶栏的文本。
; label<var>n</var> : 在第<var>n</var>行作为标签的文本。
; data<var>n</var> : 在第<var>n</var>行显示为数据的文本。
注意:在单行(比如第<var>n</var>行)中,不是所有参数组合都可用。{{para|header<var>n</var>}}会与对应的{{para|data<var>n</var>}}(以及{{para|label<var>n</var>}}、{{para|rowclass<var>n</var>}},见下)冲突,使得{{para|data<var>n</var>}}不会显示;缺少{{para|data<var>n</var>}}会隐藏对应的{{para|label<var>n</var>}}。在单行中可用的组合有:
* {{para|class<var>n</var>}} {{para|header<var>n</var>}}
* {{para|rowclass<var>n</var>}} {{para|class<var>n</var>}} {{para|data<var>n</var>}}
* {{para|rowclass<var>n</var>}} {{para|label<var>n</var>}} {{para|class<var>n</var>}} {{para|data<var>n</var>}}
可在下方[[#示例|示例]]章节查看header4、label4和data4的显示情况。
==== 编号范围 ====
在顶栏和标签/数据行的编号中使用不连续编号可以在修改信息框时增加灵活性。之后如果需要插入新行,先前使用不连续编号的信息框就不用为已存在的所有参数重新编号了。例如:
<pre>
  | header3  = 区域 1
  |  label5  = 标签 A
  |  data5  = 数据 A
  |  label7  = 标签 C
  |  data7  = 数据 C
  | header10 = 区域 2
  |  label12 = 标签 D
  |  data12 = 数据 D
</pre>
</pre>


=== 说明图片 ===
也可以自动重新编号参数名,使用[[wikipedia:User:Frietjes/infoboxgap.js]]或者[[wikipedia:Module:IncrementParams]]
; image(n)
 
: 模板顶部显示的图片. 使用完整wiki图像语法, 例如: <code><nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki></code>. 图像默认居中.
编号没有最大限制,但在两个编号之间最多只能相差50。
; caption(n)
: 图像下的文本.


=== 主数据 ===
==== 可选的数据字段 ====
; header(n)
只有标签,没有数据的行不会显示。这样可以简单地创建选填的信息。要使一行可选,填写一个默认为空的数据参数就行,像这样:
: 在第 n 行中用作标题的文本.
; label(n)
: 在第 n 行中用作标签的文本.
; data(n)
: 在第 n 行中用作数据的文本.


提示: 对于 (n) 的任何给定值, 并不是所有参数的组合都是允许的。{{Para|header(n)}} 的存在将会导致 {{Para|data(n)}} (以及 {{Para|rowclass(n)}}, {{Para|label(n)}}, 见下) 被忽略 (不显示) ; 缺少 {{Para|data(n)}} 将会导致 {{Para|label(n)}} 被忽略. 任意单行的有效组合为:  
<pre>
* {{Para|class(n)}} {{Para|header(n)}}
  | label5 = 人口
* {{Para|rowclass(n)}} {{Para|class(n)}} {{Para|data(n)}}
  data5 = {{{population|}}}
* {{Para|rowclass(n)}} {{Para|label(n)}} {{Para|class(n)}} {{Para|data(n)}}
</pre>


在下面的示例部分中查看 <code>header4</code>, <code>label4</code>和<code>data4</code>的展示方法。
这样的话,当条目未提供人口({{para|population}})参数时,信息框的这一行就不会显示。


==== 号码范围 ====
对于带有预格式化(除了数据之外还有其他内容)内容的复杂字段,在没有指定参数时它依然会显示。你可以把参数和预设内容都放进“#if”语句里,这样在没有指定参数时,预设内容也不会显示。比如下面的示例中的“#if”语句:“#if(如果):指定了mass参数|显示mass参数,后跟‘ kg’”:
为了增加更改 Infobox 布局时的灵活性, 在编写 Infobox 时使用非连续的数字作为标题/标签/数据行是有帮助的。然后可以在将来插入新行的参数, 而不必对现有的参数重新编号。例如:
<pre>
<pre>
   | header3  = Section 1
   | label6 = 质量
  |  label5  = Label A
   |  data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}
  |  data5  = Data A
  |  label7  = Label C
   |   data7 = Data C
  | header10 = Section 2
  | label12 = Label D
  |   data12 = Data D
</pre>
</pre>
也可以使用[[wikipedia:User:Frietjes/infoboxgap.js]]或[[wikipedia:Module:IncrementParams]]来自动重编参数名。


==== 使数据字段可选 ====
<nowiki />#if的更多信息可见于[[mw:Help:Extension:ParserFunctions##if]]和[[metawikimedia:ParserFunctions##if:]]。
如果一行有 label 标签 但 data 标签是空的的话, 它们两个都不会显示, 这允许轻松创建可选的 Infobox 内容行, 若要使行成为可选的, 请使用默认为空字符串的参数, 如:
 
==== 在下方所有数据字段都为空时隐藏顶栏 ====
也可以让顶栏只在其下方的某个或多个数据单元有内容时才显示。
 
考虑这种情况:
<pre>
<pre>
   |  label5 = Population
{{Infobox
   |  data5 = {{{population|}}}
  | title  = 示例:带或不带数据的顶栏
  | headerstyle = background: lightgrey;
 
  | header1 = 带有空区域的header1
   |  label2 = label2文本 |  data2 =
   |  label3 = label3文本 data3 =
  |  label4 = label4文本 |  data4 =
 
  | header5 = 带有下方数data的header5
  |  label6 = label6文本 |   data6 = 一些值
}}
</pre>
</pre>
{{Infobox
  | title  = 示例:带或不带数据的顶栏
  | headerstyle = background: lightgrey;


这样, 如果一篇条目没有在其Infobox中定义 <code>population</code> 参数, 那么该行将不会显示。
  | header1 = 带有空区域的header1
  |  label2 = label2文本 |  data2 =
  |  label3 = label3文本 |  data3 =
  |  label4 = label4文本 |  data4 =


对于具有预格式化内容的更复杂的字段, 即使没有设置参数, 它们仍然会出现, 您可以将它们全部放置在 <code>#if</code> 语句中, 以便在不使用参数时使整个内容消失。例如, 下面例子中的: "#if":
  | header5 = 带有下方data的header5
  |  label6 = label6 文本 |  data6 = 一些值
}}
{{Clear}}


定义了 <code>mass</code> 参数吗 ?
如果你希望在{{para|data<var>n</var>}}没有值时隐藏顶栏,使用{{para|autoheaders|y}}:
* 定义了: 显示参数, 后跟 <code>kg</code> ;
* 没定义: 不显示


<pre>
<pre>
   |  label6 = Mass
{{Infobox
   |  data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg | }}
  | title = 示例:带或不带数据的顶栏
  | autoheaders = y
  | headerstyle = background: lightgrey;
 
  | header1 = 带有空区域的header1
   |  label2 = label2文本 |  data2 =
  |  label3 = label3文本 |  data3 =
   |  label4 = label4文本 data4 =
 
  | header5 = 带有下方data的header5
  | label6 = label6文本 |   data6 = 一些值
}}
</pre>
</pre>
{{Infobox
  | title = 示例:带或不带数据的顶栏
  | autoheaders = y
  | headerstyle = background: lightgrey;


更多关于 <code>#if</code> 的消息, 可以看[[metawikimedia:Help:Extension:ParserFunctions|这里]]。
  | header1 = 带有空区域的header1
  |  label2 = label2文本 |  data2 =
  |  label3 = label3文本 |  data3 =
  |  label4 = label4文本 |  data4 =


==== 在所有 data 字段皆不存在的情况下隐藏 header ====
   | header5 = 带有下方data的header5
你可以用同样的方法使 header 参数可选, 参考下这个例子:
   |  label6 = label6文本 |  data6 = 一些值
{{Infobox
  | title  = 不需要的标题的例子
  | header1 = 不需要的标题
  |  label2 = 项 1      |  data2 =
  |  label3 = 项 2      |  data3 =
  |  label4 = 项 3      |  data4 =
   | header5 = 静态标题
   |  label6 = 静态项    |  data6 = 静态值
}}
}}
{{Clear}}
这样,header1会在data2、data3或data4中任意一个非空时显示。如果3个参数都为空,那么顶栏就不会显示,在到下一个可见内容之前也不会出现空行。
注意:如果数据含有空HTML元素,像{{para|data|2=&lt;span style="background: yellow;"&gt;&lt;/span&gt;}},那么这个数据会被视作非空(有数据)。
如果设置了{{para|autoheader|y}},但你不希望一些项触发顶栏,放置{{para|header<var>X</var>|}}。这会被当做空顶栏并分隔开它与后续项目。
<pre>
<pre>
{{Infobox
{{Infobox
   | title  = 可选标题的例子
   | title  = 示例:带或不带数据的空顶栏
   | header1 = 可选标题
  | autoheaders = y
   |  label2 = 项 1      |  data2 =
  | headerstyle = background: lightgrey;
   |  label3 = 项 2      |  data3 =
 
   |  label4 = 项 3      |  data4 =
   | header1 = 带有空区域的header1
   | header5 = 静态标题
   |  label2 = label2文本 |  data2 =
   |  label6 = 静态项    |  data6 = 静态值
   |  label3 = label3文本 |  data3 =
   |  label4 = label4文本 |  data4 =
 
   | header5 = _BLANK_
   |  label6 = label6文本 |  data6 = 一些值,但不会触发header1或者显示header5
}}
}}
</pre>
</pre>
{{Infobox
  | title  = 示例:带或不带数据的空顶栏
  | autoheaders = y
  | headerstyle = background: lightgrey;
  | header1 = 带有空区域的header1
  |  label2 = label2文本 |  data2 =
  |  label3 = label3文本 |  data3 =
  |  label4 = label4文本 |  data4 =
  | header5 = _BLANK_
  |  label6 = label6文本 |  data6 = 一些值,但不会触发header1或者显示header5
}}
{{Clear}}
==== 信息框脚 ====
; below : 放置在底部单元格的文本。底部单元格用于放置脚注、另见和其他类似信息。
=== 显示参数 ===
==== 斜体标题 ====
通过传递<code>italic title</code>参数,带有信息框条目的标题可显示为斜体,符合[[wikipedia:WP:ITALICTITLE|WP:ITALICTITLE]]。


如果你想让第一个标题只在一个或多个数据字段被使用时出现, 你可以参考下例:
* 在信息框中传递{{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}}来启用斜体标题。
* 传递{{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}}默认禁用斜体标题(特别是因为只有拉丁文字可以安全地以这种样式显示,而且可能需要斜体来区分外语和本地英语,而其他文字的斜体可能很难阅读),但可在一些情况下启用。
* 不传递此参数来禁用全部斜体标题。
 
==== 模板样式 ====
模板样式参数{{para|templatestyles}}、{{para|child templatestyles}}和{{para|grandchild templatestyles}}接收模板样式页的名称(例如<samp>Template:Example/styles.css</samp>),并转换为模板样式标签(<samp>&lt;templatestyles src="Template:Example/styles.css" /&gt;</samp> )。模板样式在样式化信息框时更为强力。
 
一些使用规则:
始终在{{para|bodyclass}}中添加这个信息框独有的的类,这样添加到一个信息框的样式就不会“泄露”到另一个信息框中。例如,[[Template:Infobox_settlement]]含有<code>.infobox-settlement</code>类,[[Template:Infobox_settlement/styles.css|信息框模板样式]]的所有CSS选择器都需要匹配这个类。
 
这些标签以这个顺序加载:
# 核心模板样式([[Module:Infobox/styles.css]])
# 一般模板样式({{para|templatestyles}})
# 子模板样式({{para|child templatestyles}})
# 孙模板样式({{para|grandchild templatestyles}})
 
因此,这些样式表可以“层叠”。
 
; templatestyles : 为直接调用{{tlf|Infobox}}的模板或模块添加的模板样式。
; child templatestyles : 在模板/模块调用的信息框已有{{para|templatestyles}}时,为模板/模块添加额外模板样式。
; grandchild templatestyles : 在模板/模块调用的信息框已有{{para|child templatestyles}}时,为模板/模块添加额外模板样式。
 
===== 模板样式参数使用示例 =====
一个无需支持子模板的信息框(无论是它没有子模板还是不想要子模板):
<pre>
{{Infobox
{{Infobox
   | title   = 可选标题的例子
   | title = {{{name|示例信息框}}}
  | header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | 可选标题 }}
   | bodyclass = infobox-example
   | label2 = 项 1      |  data2 = {{{item1|}}}
   | templatestyles = Template:Infobox_example/styles.css
   | label3 = 项 2      |  data3 = {{{item2|}}}
  |  label4 = 项 3      |  data4 = {{{item3|}}}
  | header5 = 静态标题
  |  label6 = 静态项 |  data6 = 静态值
}}
}}
</pre>


一个需要支持子模板的信息框:
<pre>
<pre>
{{Infobox
{{Infobox
   | title   = 可选标题的例子
   | title = {{{name|示例信息框}}}
  | header1 = {{ #if: {{{item1|}}}{{{item2|}}}{{{item3|}}} | 可选标题 }}
   | bodyclass = infobox-example {{{class|}}}
   | label2 = 项 1      |  data2 = {{{item1|}}}
   | templatestyles = Template:Infobox_example/styles.css
   | label3 = 项 2      |  data3 = {{{item2|}}}
   | child templatestyles = {{{child templatestyles|}}}
   | label4 = 项 3      |  data4 = {{{item3|}}}
  | header5 = 静态标题
  |  label6 = 静态项 |  data6 = 静态值
}}
}}
</pre>
</pre>


<code>header1</code> 将会在 <code>item1</code>, <code>item2</code>, 或 <code>item3</code> 里任何一个被定义了的情况下显示. 如果三个参数都没有定义, 则不会显示标题, 在下一个静态内容之前也不会出现空行。这里的技巧是, 只有当条件部分中没有任何内容时, <code>#if</code>才返回false, 所以只有<code>item1</code>, <code>item2</code>和<code>item3</code>三个参数都没有定义时, if语句才会返回 false。
它的一个子信息框:
<pre>
{{Infobox_example
  | title = {{{name|示例子信息框}}}
  | bodyclass = infobox-example-child
  | child templatestyles = Template:Infobox_example_child/styles.css
}}
</pre>


提示, 如果有许多数据项的值依赖于复杂的测试 (或者当将这个模板作为子信息框的递归调用生成一个数据行时) , 那么测试这种技巧有时可能非常复杂。<!-- Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like {{Para|autohide header1 | yes}}, for example, would remove the need to perform the #if test so that we can just to define {{Para|header1}} Optional header),
这样子信息框可以添加它独有的类和模板样式,叠起来了!
-->
=== 底部 ===
; below
: 最下面的单元格中的文本, 用于脚注, 参见和其他此类信息。


== 显示参数 ==
支持孙模板的方法是类似的,模板需要额外传递{{para|grandchild templatestyles}}参数,而子模板也需要传递{{para|bodyclass}}和{{para|grandchild templatestyles}}。
=== CSS 样式 ===
; bodystyle
: 应用于整个 Infobox 表格。
; titlestyle
: 应用于信息框外的标题. 添加背景颜色通常是不可取的, 因为文本是显示在信息框的 "外部" 的。
; abovestyle
: 应用于信息框顶部的 "above" 单元格。 由于此单元格通常用于标题, 默认样式为 <code>font-size:125%;</code> , 因此如果您想将上面的单元格用于常规大小的文本,请在 {{Para|abovestyle}} 中写入 "<code>font-size:100%;</code>"
; imagestyle
: 应用于图片所在的单元格. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
; captionstyle
: 应用于图片描述的文本。
; rowstyle(n)
: 此参数被插入到指定行的样式属性中。
; headerstyle
: 应用于所有 <code>header</code> 单元格。
; labelstyle
: 应用于所有 <code>label</code> 单元格。
; datastyle
: 应用于所有 <code>data</code> 单元格。
; belowstyle
: 应用于 <code>below</code> 单元格。


=== HTML 类以及微格式 ===
==== CSS样式 ====
; bodyclass
; bodystyle : 应用到整个信息框表格
: 此参数将指定的HTML class属性插入整个Infobox。
; titlestyle : 仅应用到表格上方的标题。添加背景颜色通常是不明智的,因为文本会显示在消息框'''外'''。
; titleclass
; abovestyle : 仅应用到信息框顶部单元格。默认样式有<code>font-size: 125%</code>;因为此单元格通常用于标题。如果你希望将此单元格的文本改为正常大小,在abovestyle里包含“<code>font-size: 100%</code>”。
: 此参数将指定的HTML class属性插入Infobox的标题。
; subheaderstyle : 应用到所有子标题单元格
; aboveclass
; imagestyle : 应用到图像所在的单元格,包括图像描述。在设置图像描述的文本属性时应使用captionstyle,而不是imagestyle,以防止未来图像描述移出此单元格。
: 此参数将指定的HTML class属性插入Infobox的顶部单元格。
; captionstyle : 应用到图像描述文本。
; subheaderrowclass(n)
; rowstyle<var>n</var> : 此参数插入到指定行的<code>style</code>属性中。
: 此参数将指定的HTML class属性插入指定行的subtitle。
; headerstyle : 应用到所有顶栏单元格
; subheaderclass(n)
; labelstyle : 应用到所有标签单元格
: 此参数将指定的HTML class属性插入指定行的subheader。
; datastyle : 应用到所有数据单元格
; imagerowclass(n)
; belowstyle : 仅应用到信息框底部单元格
: 此参数将指定的HTML class属性插入指定图像 (n) 所在的行中。
; imageclass''
: 此参数插入指定图像 (n) 中。
; rowclass(n)
: 此参数将指定的HTML class属性插入指定行中, 包括 label 和 data 单元格。
; class(n)
: 此参数将指定的HTML class属性插入到指定行的 data 单元格中。如果没有 data 单元格, 则参数不会生效。
; belowclass
: 此参数将指定的HTML class属性插入Infobox的底部单元格。


该模板支持添加微格式信息。 这是通过向各种数据单元添加 "class" 属性来完成的, 以指示其中包含的信息类型。 可以指定多个类名称, 以空格分隔, 其中一些名称将根据项目策略或用户首选项中选择的外观用作自定义样式的选择器, 另一些则用于微格式。
==== HTML类和微格式 ====
; bodyclass : 此参数插入到信息框(即{{tag|table|attribs=class="infobox ..."}})的<code>class</code>属性中。
; titleclass : 此参数插入到信息框'''外部标题'''的<code>class</code>属性中。<!--
当前的Lua模块未实现
; aboverowclass : 此参数插入到'''above'''单元格所在的整个表格行的<code>class</code>属性中。
-->
; aboveclass : 此参数插入到信息框'''above'''单元格的<code>class</code>属性中。
; subheaderrowclass<var>n</var> : 此参数插入到'''子标题'''所在的整个表格行的<code>class</code>属性中。
; subheaderclass<var>n</var> : 此参数插入到信息框'''子标题'''的<code>class</code>属性中。
; imagerowclass<var>n</var> : 此参数插入到'''图像'''所在的整个表格行的<code>class</code>属性中。
; imageclass : 此参数插入到'''图像'''的<code>class</code>属性中。
; rowclass<var>n</var> : 此参数插入到指定行的<code>class</code>属性中,包括'''label'''和'''data'''单元格。
; class<var>n</var> : 此参数插入到指定行中'''data'''的<code>class</code>属性中。如果没有'''data'''单元格就不会生效。<!--
当前的Lua模块未实现
; belowrowclass : 此参数插入到'''below'''单元格所在的整个表格行的<code>class</code>属性中。
-->
; belowclass : 此参数插入到信息框'''below'''单元格的<code>class</code>属性中。


例如, 要将一个信息框标记为包含hCard信息, 请添加以下参数:
此模板支持附加微格式信息。这是通过为不同data单元格添加“class”属性来实现的,不同的class属性可以指示相关数据单元格包含何种类型的信息。可以指定多个类名,使用空格分隔,其中一些类作为CSS选择器,附加相关样式,另一些用于微格式。


<pre> | bodyclass = vcard </pre>
要标记一个信息框包含[[wikipedia:hCard|hCard]]信息,作为示例,添加下方参数:
 
<pre>
对于包含vcard一部分数据单元的每一行,添加一个相应的 class 参数:
  | bodyclass = vcard
</pre>


为于每行包含属于vcard一部分的data单元格,添加一个相应的class参数:
<pre>
<pre>
   | class1 = fn
   | class1 = fn
第247行: 第345行:
</pre>
</pre>


...等等。 也可以给 "above" 和 "title" 加上类, 因为它们通常用于显示信息框主题的名称。
…等等。通常用于显示信息框主题的“above”和“title”也可以添加类。
 
可在[[wikipedia:Wikipedia:WikiProject Microformats]]获取在wiki内添加微格式信息的进一步信息,访问[https://microformats.org 微格式官方网站]亦能获取更一般性的信息。


== 例子 ==
== 示例 ==
注意,当定义了标签但相关的数据单元格为空时,那一行不会显示在信息框中;在一行中同时定义了顶栏、标签和数据时,只有顶栏会显示。也要注意,子标题(subheader)默认不像用于分隔主要数据区域的顶栏(header)那样显示为粗体,因为子标题的角色像顶部单元格(above)。
 
<pre>
{{Infobox
{{Infobox
   | name         = Infobox
   | name = Infobox/doc
   | bodystyle   =  
   | bodystyle =
   | title       = 测试信息框
 
   | titlestyle   =  
  | titlestyle =
   | image       = [[File:example.png|200px]]
  | abovestyle = background: #cfc;
  | imagestyle  =
  | subheaderstyle =
   | caption     = Caption for example.png
   | title = 测试信息框
  | captionstyle =
   | above = 顶部文本
   | headerstyle = background:#ccf;
  | subheader  = 图像上方的子标题
   | labelstyle   = background:#ddf;
  | subheader2 = 第2个子标题
   | datastyle   =  
 
  | imagestyle =
   | captionstyle =
   | image   = [[File:Example.png|200px|alt=示例替代文本]]
   | caption = 显示在File:Example.png下方的描述
 
   | headerstyle = background: #ccf;
   | labelstyle = background: #ddf;
   | datastyle   =


   | header1 = 独自定义的顶栏
   | header1 = 独自定义的顶栏
   | label1 =  
   | label1 =
   | data1   =  
   |   data1 =
   | header2 =  
   | header2 =
   | label2 = 独自定义的标签
   | label2 = 独自定义的标签,不会显示,只有对应的数据存在时才会显示
   | data2   =  
   |   data2 =
   | header3 =
   | header3 =
   | label3 =  
   | label3 =
   | data3   = 独自定义的数据
   |   data3 = 独自定义的数据
   | header4 = 三项均有定义 (顶栏)
   | header4 = 三项均有定义(顶栏)
   | label4 = 三项均有定义 (标签)
   | label4 = 不会显示(因为与顶栏的编号相同)
   | data4   = 三项均有定义 (数据)
   |   data4 = 不会显示(因为与顶栏的编号相同)
   | header5 =
   | header5 =
   | label5 = 标签和数据有定义 (标签)
   | label5 = 定义的标签和数据(标签)
   | data5   = 标签和数据有定义 (数据)
   |   data5 = 定义的标签和数据(数据)


   | belowstyle = background:#ddf;
   | belowstyle = background: #ddf;
   | below = 下方文本
   | below = 底部文本
}}
}}
<pre>
</pre>
{{Infobox
{{Infobox
   | name         = Infobox
   | name = Infobox/doc
   | bodystyle   =  
   | bodystyle =
   | title       = 测试信息框
 
   | titlestyle   =  
  | titlestyle =
   | image       = [[File:example.png|200px]]
  | abovestyle = background: #cfc;
  | imagestyle  =
  | subheaderstyle =
   | caption     = Caption for example.png
   | title = 测试信息框
  | captionstyle =
   | above = 顶部文本
   | headerstyle = background:#ccf;
  | subheader  = 图像上方的子标题
   | labelstyle   = background:#ddf;
  | subheader2 = 第2个子标题
   | datastyle   =  
 
  | imagestyle =
   | captionstyle =
   | image   = [[File:Example.png|200px|alt=示例替代文本]]
   | caption = 显示在File:Example.png下方的描述
 
   | headerstyle = background: #ccf;
   | labelstyle = background: #ddf;
   | datastyle   =


   | header1 = 独自定义的顶栏
   | header1 = 独自定义的顶栏
   | label1 =  
   | label1 =
   | data1   =  
   |   data1 =
   | header2 =  
   | header2 =
   | label2 = 独自定义的标签
   | label2 = 独自定义的标签,不会显示,只有对应的数据存在时才会显示
   | data2   =  
   |   data2 =
   | header3 =
   | header3 =
   | label3 =  
   | label3 =
   | data3   = 独自定义的数据
   |   data3 = 独自定义的数据
   | header4 = 三项均有定义 (顶栏)
   | header4 = 三项均有定义(顶栏)
   | label4 = 三项均有定义 (标签)
   | label4 = 不会显示(因为与顶栏的编号相同)
   | data4   = 三项均有定义 (数据)
   |   data4 = 不会显示(因为与顶栏的编号相同)
   | header5 =
   | header5 =
   | label5 = 标签和数据有定义 (标签)
   | label5 = 定义的标签和数据(标签)
   | data5   = 标签和数据有定义 (数据)
   |   data5 = 定义的标签和数据(数据)


   | belowstyle = background:#ddf;
   | belowstyle = background: #ddf;
   | below = 下方文本
   | below = 底部文本
}}
}}
</pre>
{{Clear}}


这个示例中,{{para|bodystyle}}和{{para|labelstyle}}参数用来调整信息框宽度,并设定label一列的默认宽度:
<pre>
{{Infobox
{{Infobox
   | name         = Infobox/doc
   | name = Infobox/doc
   | bodystyle   =  
   | bodystyle = width: 20em;
 
  | titlestyle    =
  | abovestyle    = background: rgb(204, 255, 204);
  | subheaderstyle =
  | title          = 测试信息框
  | above          = 顶部文本
  | subheader      = 图像之上的子标题
  | subheader2    = 第二个子标题


   | imagestyle  =
   | titlestyle =
  | captionstyle =
   | title = 测试信息框
  |  image      = [[File:Example-serious.jpg|200px|alt=Example alt text]]
   | caption      = 在 Example-serious.jpg 之下显示的描述


   | headerstyle = background: rgb(204, 204, 255);
   | headerstyle =
   | labelstyle   = background: rgb(221, 221, 255);
   | labelstyle = width: 33%;
   | datastyle   =  
   | datastyle   =


   | header1 = 独自定义的顶栏 (<code>header</code>)
   | header1 =
  | label1 =  
  | label1 = 标签1
  |   data1 =  
  | data1 = 数据1
   | header2 =  
   | header2 =
   |  label2 = 独自定义的 <code>label</code> 不会被显示 (需要 <code>data</code>, or is suppressed)
   |  label2 = 标签2
   |  data2 =  
   |  data2 = 数据2
   | header3 =
   | header3 =
   |  label3 =  
   |  label3 = 标签3
   |  data3 = 独自定义的 <code>data</code>
   |  data3 = 数据3
   | header4 = 三个参数都被定义 (header, label, data, 都使用一个编号)
   | header4 = 顶栏4
   |  label4 = 不会显示 (与 header 的编号一样)
   |  label4 =
   |  data4 = 不会显示 (与 header 的编号一样)
   |  data4 =
   | header5 =
   | header5 =
   |  label5 = 定义了 <code>label</code> 和 <code>data</code> (label)
   |  label5 = 标签5
   |  data5 = 定义了 <code>label</code> 和 <code>data</code> (data)
   |  data5 = 数据5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


   | belowstyle = background: rgb(221, 221, 255);
   | belowstyle =
   | below     = 底部文本
   | below = 底部文本
}}
}}
<pre>
</pre>
{{Infobox
{{Infobox
   | name         = {{subst:PAGENAME}}
   | name = Infobox/doc
   | bodystyle   =
   | bodystyle = width: 20em;
 
  | titlestyle    =  
  | abovestyle    = background: rgb(204, 255, 204);
  | subheaderstyle =
  | title          = 测试信息框
  | above          = 顶部文本
  | subheader      = 图像之上的子标题
  | subheader2    = 第二个子标题


   | imagestyle  =
   | titlestyle =
  | captionstyle =
   | title = 测试信息框
  |  image      = [[File:Example-serious.jpg|200px|alt=Example alt text]]
   | caption      = 在 Example-serious.jpg 之下显示的描述


   | headerstyle = background: rgb(204, 204, 255);
   | headerstyle =
   | labelstyle   = background: rgb(221, 221, 255);
   | labelstyle = width: 33%;
   | datastyle   =  
   | datastyle   =


   | header1 = 独自定义的顶栏 (<code>header</code>)
   | header1 =
  | label1 =  
  | label1 = 标签1
  |   data1 =  
  | data1 = 数据1
   | header2 =  
   | header2 =
   |  label2 = 独自定义的 <code>label</code> 不会被显示 (需要 <code>data</code>, or is suppressed)
   |  label2 = 标签2
   |  data2 =  
   |  data2 = 数据2
   | header3 =
   | header3 =
   |  label3 =  
   |  label3 = 标签3
   |  data3 = 独自定义的 <code>data</code>
   |  data3 = 数据3
   | header4 = 三个参数都被定义 (header, label, data, 都使用一个编号)
   | header4 = 顶栏4
   |  label4 = 不会显示 (与 header 的编号一样)
   |  label4 =
   |  data4 = 不会显示 (与 header 的编号一样)
   |  data4 =
   | header5 =
   | header5 =
   |  label5 = 定义了 <code>label</code> 和 <code>data</code> (label)
   |  label5 = 标签5
   |  data5 = 定义了 <code>label</code> 和 <code>data</code> (data)
   |  data5 = 数据5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


   | belowstyle = background: rgb(221, 221, 255);
   | belowstyle =
   | below     = 底部文本
   | below = 底部文本
}}
}}
</pre>
{{Clear}}


== 嵌入 ==
== 嵌入 ==
一个信息框可以使用 {{Para|child}} 参数 和 {{Para|embed}} 参数来嵌入另一个信息框此功能可用于创建模块化的信息框, 或创建定义更好的逻辑部分。很久以前, 为了创建包含超过99行内容的信息框, 需要使用嵌入; 但是现在在单个{{tl|Infobox}}中定义的行数没有限制。
信息框可以通过使用{{para|child}}参数嵌入到另一个信息框中。这一功能可用于创建模块化信息框,或者创建逻辑定义更好的区域。很久之前,为了创建有超过99行内容的信息框,需要使用嵌入功能,但现在单一信息框没有行数限制了。
 
<pre>
{{Infobox
{{Infobox
   | title = 顶部标题行
   | title = 顶层标题
   | data1 = {{Infobox | decat = yes | child = yes
   | data1 = {{Infobox | decat = yes | child = yes
     | title = 第一个子部分
     | title = 第1个子部分
     | label1= Label 1.1
     | label1 = 标签1.1
     | data1 = Data 1.1
     | data1 = 数据1.1
  }}
  }}
   | data2 = {{Infobox | decat = yes | child = yes
   | data2 = {{Infobox | decat = yes | child = yes
     | title = 第二个子部分
     | title = 第2个子部分
     | label1 = Label 2.1
     | label1 = 标签2.1
     | data1 = Data 2.1
     | data1 = 数据2.1
  }}
  }}
   | belowstyle =  
   | belowstyle =
   | below = 底部文本
   | below = 底部文本
}}
}}
<pre>
</pre>
{{Infobox
{{Infobox
   | title = 顶部标题行
   | title = 顶层标题
   | data1 = {{Infobox | decat = yes | child = yes
   | data1 = {{Infobox | decat = yes | child = yes
     | title = 第一个子部分
     | title = 第1个子部分
     | label1= Label 1.1
     | label1 = 标签1.1
     | data1 = Data 1.1
     | data1 = 数据1.1
  }}
  }}
   | data2 = {{Infobox | decat = yes | child = yes
   | data2 = {{Infobox | decat = yes | child = yes
     | title = 第二个子部分
     | title = 第2个子部分
     | label1 = Label 2.1
     | label1 = 标签2.1
     | data1 = Data 2.1
     | data1 = 数据2.1
  }}
  }}
   | belowstyle =  
   | belowstyle =
   | below = 底部文本
   | below = 底部文本
}}
}}
</pre>
{{Clear}}


注意, 在上面的示例中, 子{{tl|Infobox}}放在 <code>data</code> 字段中, 而不是 <code>header</code> 字段中。如果没有显式地指定粗体, 则子Infobox的标题不会是粗体。要获得粗体的子{{tl|Infobox}}标题, 可以将子Infobox放在 <code>header</code> 字段中 (但不要放在 <code>label</code> 字段中, 因为它不会显示! )
注意,上例中,子信息框放置在数据字段中,而非顶栏字段。除非特别指定,否则子信息框标题不会显示为粗体。如需让子部分标题显示为粗体,除了使用CSS外,也可以考虑使用下面的方法:
<pre>
{{Infobox
{{Infobox
   | title = 顶部标题行
   | title = 顶层标题
   | header1 = {{Infobox | decat = yes | child = yes
   | header1 = 第1个子部分
    | title  = 第一个子部分
   | data2 = {{Infobox | decat = yes | child = yes
    | label1 = Label 1.1
     | label1 = 标签1.1
    | data1  = Data 1.1
     | data1 = 数据1.1
  }}
   | header2  = {{Infobox | decat = yes | child = yes
    | title  = 第二个子部分
     | label1 = Label 2.1
     | data1 = Data 2.1
   }}
   }}
| belowstyle =
   | header3 = 第2个子部分
| below      = 底部文本
   | data4 = {{Infobox | decat = yes | child = yes
}}
     | label1 = 标签2.1
<pre>
     |  data1 = 数据2.1
{{Infobox
   | title = 顶部标题行
   | header1  = {{Infobox | decat = yes | child = yes
    | title  = 第一个子部分
     | label1 = Label 1.1
     | data1 = Data 1.1
  }}
  | header2  = {{Infobox | decat = yes | child = yes
    | title  = 第二个子部分
    | label1 = Label 2.1
    | data1 = Data 2.1
   }}
   }}
| belowstyle =  
  | belowstyle =
| below     = 底部文本
  | below = 底部文本
}}
}}
</pre>
</pre>
{{Infobox
{{Infobox
   | title = 顶部标题行
   | title = 顶层标题
   | header1 = 第一个子部分<!--
   | header1 = 第1个子部分
-->{{Infobox | decat = yes | child = yes
  | data2 = {{Infobox | decat = yes | child = yes
      | label1 = Label 1.1
    | label1 = 标签1.1
      | data1 = Data 1.1
    | data1 = 数据1.1
    }}
  }}
   | header2 = 第二个子部分<!--
   | header3 = 第2个子部分
-->{{Infobox | decat = yes | child = yes
  | data4 = {{Infobox | decat = yes | child = yes
      | label1 = Label 2.1
    | label1 = 标签2.1
      |  data1 = Data 2.1
    |  data1 = 数据2.1
    }}
  }}
   | belowstyle =  
   | belowstyle =
   | below = 底部文本
   | below = 底部文本
}}
}}
{{Clear}}
在不使用{{para|title}}且不在嵌入的信息框前面添加任何文本的话,可能会在子信息框前生成一个空表格行,在视觉上添加间隙。空表格行可以用{{para|rowstyle<var>n</var>|display: none;}}来隐藏,将<var>n</var>替换为数据行的编号。
[[wikipedia:Wikipedia:WikiProject Infoboxes/embed]]包含一些链接,指向使用嵌入到其他信息框的信息框的条目。
== 子盒 ==
另一种嵌入方法是使用{{para|subbox|yes}},这种方法移除信息框外部边框,但保留嵌入信息框的内部结构。这种方法的一个特点是子、父信息框不必含有相同的结构,标签和数据字段在两个信息框之间也不会对齐,因为他们的父表格不相同。
<pre>
<pre>
{{Infobox
{{Infobox
   | title = 顶部标题行
   | headerstyle = background-color: #eee;
   | header1 = 第一个子部分<!--
  |  labelstyle = background-color: #eee;
-->{{Infobox | decat = yes | child = yes
 
      | label1 = Label 1.1
   | header1 = 主 1
      | data1  = Data 1.1
  | header2 = 主 2
     }}
  | data3 = {{Infobox | subbox = yes
  | header2 = 第二个子部分<!--
    | headerstyle = background-color: #ccc;
  -->{{Infobox | decat = yes | child = yes
    | labelstyle  = background-color: #ddd;
      | label1 = Label 2.1
 
      | data1 = Data 2.1
    | header1 = 子 3-1
    }}
     | header2 = 子 3-2
   | belowstyle =  
    | label3 = 标签 3-3 | data3 = 数据 3-3
   | below = 底部文本
  }}
  | data4 = {{Infobox | subbox = yes
    | labelstyle  = background-color: #ccc;
    | label1 = 标签 4-1 | data1 = 数据 4-1
  }}
   | label5 = 标签 5 | data5 = 数据 5
   | header6 = 主 6
}}
}}
</pre>
</pre>
{{Infobox
  | headerstyle = background-color: #eee;
  |  labelstyle = background-color: #eee;


注意, 省略 {{Para|title}}参数, 并且不包含嵌入 Infobox 之前的任何文本, 可能会导致虚假的空白表格行, 在实际观看中创建空白。
  | header1 = 主 1
  | header2 = 主 2
  | data3 = {{Infobox | subbox = yes
    | headerstyle = background-color: #ccc;
    | labelstyle  = background-color: #ddd;


== Subbox ==
     | header1 = 3-1
另一种嵌入方法是使用{{Para|subbox|yes}}, 它从 Infobox 中删除外部边框, 但保留内部结构。这种方法的一个特性是, 父 Infobox 和子 Infobox 不必具有相同的结构, 并且标签和数据字段在父盒和子盒之间没有对齐, 因为它们不在同一个父表格 (tabel) 中。
     | header2 = 3-2
{{Infobox
     |  label3 = 标签 3-3 | data3 = 数据 3-3
  | headerstyle = background-color: rgb(238, 238, 238);
  }}
  | labelstyle  = background-color: rgb(238, 238, 238);
   | data4 = {{Infobox | subbox = yes
  | header1 = Main 1
     | labelstyle  = background-color: #ccc;
  | header2 = Main 2
     |  label1 = 标签 4-1 | data1 = 数据 4-1
  |  data3 = {{Infobox | subbox = yes
  }}
    | headerstyle = background-color: rgb(204, 204, 204);
   |  label5 = 标签 5 | data5 = 数据 5
    | labelstyle  = background-color: rgb(221, 221, 221);
   | header6 = 6
     | header1 = Sub 3-1
     | header2 = Sub 3-2
     |  label3 = Label 3-3  
    |   data3 = Data 3-3
  }}
   |   data4 = {{Infobox | subbox = yes
     | labelstyle  = background-color: rgb(204, 204, 204);
     |  label1 = Label 4-1  
    |   data1 = Data 4-1
  }}
   |  label5 = Label 5  
  |   data5 = Data 5
   | header6 = Main 6
}}
}}
{{Clear}}
相似的嵌入技术可以用在其他生成表格的模板的内容参数(例如{{tl|Sidebar}}):
<pre>
<pre>
{{Infobox
{{Sidebar
   | headerstyle = background-color: rgb(238, 238, 238);
   | navbar = off
   | labelstyle  = background-color: rgb(238, 238, 238);
   | headingstyle = background-color: #eee;
   | header1 = Main 1
   | heading1 = 标题 1
   | header2 = Main 2
   | heading2 = 标题 2
   |   data3 = {{Infobox | subbox = yes
   | content3 = {{Infobox | subbox = yes
     | headerstyle = background-color: rgb(204, 204, 204);
     | headerstyle = background-color:#ccc;
     | labelstyle = background-color: rgb(221, 221, 221);
     | labelstyle = background-color:#ddd;
     | header1 = Sub 3-1
     | header1 = 3-1
     | header2 = Sub 3-2
     | header2 = 3-2
     |  label3 = Label 3-3  
     |  label3 = 标签 3-3 | data3 = 数据 3-3
    |   data3 = Data 3-3
  }}
  }}
   | content4 = {{Infobox | subbox = yes
   |   data4 = {{Infobox | subbox = yes
     | labelstyle = background-color: #ccc;
     | labelstyle = background-color: rgb(204, 204, 204)c;
     |  label1 = 标签 4-1 | data1 = 数据 4-1
     |  label1 = Label 4-1  
  }}
    |   data1 = Data 4-1
   | heading5 = 标题 5
  }}
   | label5 = Label 5  
  |  data5 = Data 5
  | header6 = Main 6
}}
}}
</pre>
</pre>
注意, 包含每个子框的父数据单元格的默认填充 (padding) 仍然可见, 因此子框比父框略窄, 并且父框的标准单元格之间的垂直间距比不同子框的单元格之间的垂直间距大。
{{Sidebar
  | navbar = off
  | headingstyle = background-color: #eee;
  | heading1 = 标题 1
  | heading2 = 标题 2
  | content3 = {{Infobox | subbox = yes
    | headerstyle = background-color:#ccc;
    | labelstyle = background-color:#ddd;
    | header1 = 子 3-1
    | header2 = 子 3-2
    |  label3 = 标签 3-3 | data3 = 数据 3-3
  }}
  | content4 = {{Infobox | subbox = yes
    | labelstyle = background-color: #ccc;
    |  label1 = 标签 4-1 | data1 = 数据 4-1
  }}
  | heading5 = 标题 5
}}
{{clear}}
 
包含每个子盒的父数据单元格的默认内边距依然可见,因此子盒比父盒略窄,并且父盒标准单元格之间的垂直间距比不同子盒单元格之间的垂直间距大。
 
== 在嵌入的不带点列表中控制换行 ==
{{tlx|nbsp}}模板可以和{{tlx|wbr}}和{{tlx|nowrap}}一起用来控制嵌入在信息框中的不带点列表的换行(例如:[[wikipedia:Template:Infobox film]]中的参演人员列表)。要防止包装的长实体和其他实体之间混淆,参见[[Template:Wbr/doc#控制信息框中的换行]]获取详情。
 
== 完整空白语法 ==
注意:行编号是无限的,下面只提供20个编号,因为使用更大编号的信息框相对比较少见,在需要时扩展编号就行。微格式“class”参数也省略掉了,因为它们不太常用。


== 完全空白语法 ==
(注意: 可能的行数没有限制;下面只给出了20个, 因为使用的参数比这个多的信息框相对来说比较少。只要根据需要扩展编号即可。微格式 "class" 参数也被省略, 因为它们不常用。)
<pre>
<pre>
{{Infobox
{{Infobox
   | name           = {{subst:PAGENAME}}
   | name = {{subst:PAGENAME}}
   | child         = {{{child|}}}
   | child = {{{child|}}}
   | subbox         = {{{subbox|}}}
   | subbox = {{{subbox|}}}
   | italic title   = {{{italic title|no}}}
   | italic title = {{{italic title|no}}}
   | bodystyle     =  
  | templatestyles =
  | child templatestyles =
  | grandchild templatestyles =
   | bodystyle =
 
  | titlestyle =
  | abovestyle =
  | subheaderstyle =


  | titlestyle    =
   | title =
  | abovestyle    =
   | above =
  | subheaderstyle =
   | subheader =
   | title         =  
   | above         =  
   | subheader     =  


   |   imagestyle  =  
   | imagestyle  =
   | captionstyle   =
   | captionstyle =
  |  image        =
  | caption        =
  |  image2      =
  | caption2      =  


   | headerstyle    =
   |  image =
  |  labelstyle    =
   | caption =
  |  datastyle    =
   |  image2 =
  | header1  =
   | caption2 =
  |  label1  =
  |  data1  =
  | header2  =
  |  label2  =
  |  data2  =
  | header3  =
  |  label3  =
  |  data3  =
  | header4  =
  |  label4  =
  |  data4  =
  | header5  =
  |  label5  =
  |  data5  =
  | header6  =
  |  label6  =
  |  data6  =
  | header7  =
  |  label7  =
  |  data7  =
  | header8  =
  |  label8  =
  |  data8  =
  | header9  =
  |  label9  =
  |  data9  =
  | header10 = 
  |  label10 =
  |  data10 =
  | header11 =
  |  label11 =
  |  data11 =
  | header12 =
  |  label12 =
  |  data12 =
   | header13 =
  | label13 =
  |  data13 =
  | header14 =  
   |  label14 =  
   |  data14 =  
   | header15 =
  |  label15 =
  |  data15 =
  | header16 =
  |  label16 =
  |  data16 =
  | header17 =
  |  label17 =
  |  data17 =
  | header18 =
  |  label18 =
  |  data18 =
  | header19 =
  |  label19 =
  |  data19 =
  | header20 =
  |  label20 =
  |  data20 =  


   | belowstyle     =  
  | headerstyle =
   | below         =  
  |  labelstyle =
  |  datastyle =
 
  | header1  =
  |  label1  =
  |  data1  =
  | header2  =
  |  label2  =
  |  data2  =
  | header3  =
  |  label3  =
  |  data3  =
  | header4  =
  |  label4  =
  |  data4  =
  | header5  =
  |  label5  =
  |  data5  =
  | header6  =
  |  label6  =
  |  data6  =
  | header7  =
  |  label7  =
  |  data7  =
  | header8  =
  |  label8  =
  |  data8  =
  | header9  =
  |  label9  =
  |  data9  =
  | header10 =
  |  label10 =
  |  data10 =
  | header11 =
  |  label11 =
  |  data11 =
  | header12 =
  |  label12 =
  |  data12 =
  | header13 =
  |  label13 =
  |  data13 =
  | header14 =
  |  label14 =
  |  data14 =
  | header15 =
  |  label15 =
  |  data15 =
  | header16 =
  |  label16 =
  |  data16 =
  | header17 =
  |  label17 =
  |  data17 =
  | header18 =
  |  label18 =
  |  data18 =
  | header19 =
  |  label19 =
  |  data19 =
  | header20 =
  |  label20 =
  |  data20 =
 
   | belowstyle =
   | below =
}}
}}
</pre>
</pre>
</noinclude>
 
== 移植到其他MediaWiki ==
{{tlf|Infobox}}依赖于[[mw:Extension:Scribunto]]和[[mw:Extension:TemplateStyles]]扩展,[[mw:Extension:ParserFunction]]扩展很可能也是必需的,所以目标MediaWiki需要安装这三个扩展。你需要复制以下页面:
* [[Template:Infobox]] — 主模板;
** [[Template:Infobox/doc]] — 可选的模板文档,应该也可以直接复制,但安装了[[mw:Extension:TemplateData]]扩展才能支持模板数据。
* [[Module:Infobox]] — 生成信息框的Lua模块;
* [[Module:Infobox/styles.css]] — 信息框CSS样式。
 
Lua模块也有自己的依赖项,全复制过去。
 
== 模板数据 ==
== 模板数据 ==
{{TemplateData header}}
{{TemplateData header}}
<templatedata>
<templatedata>
{
{
"description": "本模板为一系列 \"信息框\" 板的元模板, 即本模板用于构建其他模板。通常不建议在条目中直接使用此模板, 但是如有需要, 可以在个别 \"一次性\" 情况中直接使用。 ",
"params": {
"params": {
"name": {
"name": {
"label": "名称",
"label": "名称",
"description": "如果有这个参数, \"view/discussion/edit\" 链接将添加到信息框的底部, 指向该模板指定的页面",
"description": "信息框底部“查看·编辑·讨论”链接指向模板的名称,如果不指定命名空间,会在链接前添加“Template:”(模板)前缀。",
"example": "Infobox comic",
"type": "line",
"type": "string"
"autovalue": "{{subst:PAGENAME}}"
},
"child": {
"label": "子盒式",
"description": "模板是否以子盒格式显示",
"type": "boolean"
},
},
"child": {},
"embed": {
"subbox": {
"label": "嵌入式",
"label": "子信息框",
"description": "模板是否以嵌入格式显示",
"description": "指定该信息框是否为一个子信息框",
"type": "boolean"
"example": "yes",
"type": "string"
},
},
"decat": {
"decat": {
"label": "禁用维护分类",
"label": "禁用分类",
"description": "如果将此设置为 \"yes\" , 则当生成的信息框有一些问题或没有可见数据部分时, 当前页面将不会自动分类到维护类别中",
"description": "模板是否会禁用维护分类",
"type": "string"
"type": "boolean"
},
},
"bodystyle": {
"italic title": {
"label": "信息框 CSS样式",
"label": "斜体标题",
"description": "作用于整个信息框的CSS样式",
"description": "启用后页面标题会变为斜体",
"type": "string"
"type": "boolean",
"deprecated": "暂不支持功能"
},
},
"titlestyle": {
"autoheaders": {
"label": "标题 (信息框外部) CSS样式",
"label": "自动顶栏",
"description": "作用于信息框标题的CSS样式",
"description": "启用本功能的话,下方没有非空数据字段的顶栏都会被隐藏。",
"type": "string"
"type": "boolean"
},
},
"abovestyle": {
"templatestyles": {
"label": "标题 (信息框内部) CSS样式",
"label": "模板样式",
"description": "作用于标题的CSS样式",
"description": "信息框需要加载的模板样式",
"type": "string"
"example": "Template:Infobox_exmaple/styles.css",
"type": "line"
},
},
"imagestyle": {
"child templatestyles": {
"label": "图像 CSS样式",
"label": "子模板样式",
"description": "作用于图像的CSS样式",
"description": "子模板加载的模板样式,重复示例中的值就行。使用此功能也需要为bodyclass参数的最后一个类后面添加{{{bodyclass|}}},例如“bodyclass = infobox-example {{{bodyclass|}}}”。",
"type": "string"
"example": "{{{child templatestyles|}}}",
"type": "line"
},
},
"captionstyle": {
"grandchild templatestyles": {
"label": "图像描述 CSS样式",
"label": "孙模板样式",
"description": "作用于图像描述的CSS样式",
"description": "孙模板加载的模板样式,重复示例中的值就行。详情参见模板文档的“模板样式”一节。",
"type": "string"
"example": "{{{grand templatestyles|}}}",
"type": "line"
},
},
"headerstyle": {
"bodyclass": {
"label": "header CSS样式",
"label": "整体HTML类",
"description": "作用于所有 header 参数 (header1, header2, header3...) 的 CSS 样式",
"description": "添加到信息框整体的HTML类",
"type": "string"
"example": "infobox-settlement vcard",
"type": "line"
},
},
"labelstyle": {
"bodystyle": {
"label": "label CSS样式",
"label": "整体CSS样式",
"description": "作用于所有 label 参数 (label1, label2, label3...) 的 CSS 样式",
"description": "应用到信息框整体的CSS样式",
"example": "float: none;",
"type": "string"
"type": "string"
},
},
"datastyle": {
"titleclass": {
"label": "data CSS样式",
"label": "标题HTML类",
"description": "作用于所有 data 参数 (data1, data2, data3...) 的 CSS 样式",
"description": "添加到信息框外部标题的HTML类",
"type": "string"
"type": "line"
},
},
"belowstyle": {
"aboveclass": {
"label": "below CSS 样式",
"label": "顶部单元格HTML类",
"description": "作用于 below 参数 (信息框所有内容的底部) 的 CSS 样式",
"description": "添加到顶部单元格的HTML类",
"type": "string"
"type": "string"
},
},
"bodyclass": {
"subheaderrowclass2": {
"label": "信息框 CSS类",
"label": "子标题2表格行HTML类",
"description": "作用于整个信息框的CSS类",
"description": "添加到子标题2所处表格行的HTML类,编号可以继续延长",
"type": "string"
"type": "line"
},
},
"titleclass": {
"subheaderclass2": {
"label": "标题 (信息框外) CSS类",
"label": "子标题2 HTML类",
"description": "作用于标题 (信息框外) 的CSS类"
"description": "添加到子标题2单元格的HTML类,编号可以继续延长",
"type": "line"
},
},
"aboveclass": {
"titlestyle": {
"label": "标题 (信息框内) CSS类",
"label": "标题CSS样式",
"description": "作用于标题 (信息框内) 的CSS类",
"description": "应用到信息框外部标题的CSS样式",
"type": "string"
"type": "string"
},
},
"imageclass": {
"abovestyle": {
"label": "图像 CSS类",
"label": "顶部单元格CSS样式",
"description": "作用于所有图像的CSS类",
"description": "应用到顶部单元格的CSS样式",
"type": "string"
"type": "line"
},
},
"belowclass": {
"subheaderstyle": {
"label": "底部单元格 CSS类",
"label": "子标题CSS样式",
"description": "作用于底部单元格的CSS类",
"description": "应用到所有子标题的CSS样式"
"type": "string"
},
},
"title": {
"title": {
"label": "标题 (信息框外)",
"label": "标题",
"type": "unbalanced-wikitext",
"description": "信息框外部标题",
"description": "输入内容..."
"type": "content"
},
},
"above": {
"above": {
"label": "标题 (信息框内)",
"label": "顶部单元格",
"type": "unbalanced-wikitext",
"description": "信息框最上方的单元格(内部标题)",
"description": "输入内容..."
"type": "content"
},
},
"subtitle": {
"subheader": {
"label": "子标题 #1",
"aliases": [
"type": "unbalanced-wikitext"
"subheader1"
],
"label": "子标题1",
"description": "信息框的第1个子标题",
"type": "content"
},
},
"subheaderrowclass": {
"subheaderrowclass": {
"label": "子标题行 #1 CSS类",
"aliases": [
"description": "应用到子标题 (n) 所在行的CSS类",
"subheaderrowclass1"
"type": "string"
],
"label": "子标题1表格行HTML类",
"description": "添加到子标题1所处表格行的HTML类",
"type": "line"
},
},
"subheaderclass": {
"subheaderclass": {
"label": "subheader #1 CSS类",
"aliases": [
"description": "应用到subheader (n) 的CSS类",
"subheaderclass1"
"type": "string"
],
"label": "子标题1 HTML类",
"description": "添加到子标题1单元格的HTML类",
"type": "line"
},
"subheader2": {
"label": "子标题2",
"description": "信息框的第2个子标题,编号可以继续延长",
"type": "content"
},
"imagerowclass": {
"aliases": [
"imagerowclass1"
],
"label": "图像1表格行HTML类",
"description": "添加到图像1所处表格行的HTML类",
"type": "line"
},
"imagerowclass2": {
"label": "图像2表格行HTML类",
"description": "添加到图像2所处表格行的HTML类",
"type": "line"
},
},
"subtitle2": {
"imageclass": {
"label": "子标题 #2",
"label": "图像HTML类",
"type": "unbalanced-wikitext"
"description": "添加到所有图像单元格的HTML类",
"type": "line"
},
},
"subheaderrowclass2": {
"imagestyle": {
"label": "子标题行 #2 CSS类",  
"label": "图像CSS样式",
"inherits": "subheaderrowclass"
"description": "应用到所有图像单元格的CSS样式",
"type": "line"
},
},
"subheaderclass2": {
"captionstyle": {
"label": "subheader #2 CSS类",
"label": "图像描述CSS样式",
"inherits": "subheaderclass"
"description": "应用到所有图像描述文本的CSS样式",
"type": "line"
},
},
"image": {
"image": {
"label": "图像 #1",
"aliases": [
"description": "使用标准的wiki图像语法",
"image1"
"type": "wiki-file-name"
],
"label": "图像1",
"description": "第1张图像,信息框图像显示在子标题下。图像使用完整wikitext图像语法。",
"example": "[[File:Example.png|200px|替代文本]]",
"type": "line"
},
},
"caption": {
"caption": {
"label": "图像描述 #1",
"aliases": [
"description": "图像(n)的描述",
"caption1"
"type": "unbalanced-wikitext"
],
},
"label": "图像描述1",
"imagerowclass": {
"description": "图像1的描述文本",
"label": "图像行 #1 CSS类 ",
"type": "content"
"description": "应用到图像 (n) 所在行的 CSS类",
"type": "string"
},
},
"image2": {
"image2": {
"label": "图像 #2"
"label": "图像2",
"description": "第2张图像,编号可以继续延长",
"type": "line"
},
},
"caption2": {
"caption2": {
"label": "图像描述 #2"
"label": "图像描述2",
"description": "图像2的描述文本,编号可以继续延长",
"type": "content"
},
},
"imagerowclass2": {
"headerstyle": {
"label": "图像行 #2 CSS类 ",
"label": "顶栏CSS样式",
"inherits": "imagerowclass"
"description": "应用到所有顶栏单元格的CSS样式",
"type": "line"
},
"labelstyle": {
"label": "标签CSS样式",
"description": "应用到所有标签单元格的CSS样式",
"type": "line"
},
"datastyle": {
"label": "数据CSS样式",
"description": "应用到所有数据单元格的CSS样式",
"type": "line"
},
"rowclass1": {
"label": "行1 HTML类",
"description": "添加到第1个内容行的HTML类",
"type": "line"
},
"class1": {
"label": "数据1 HTML类",
"description": "应用到数据1单元格的HTML类",
"type": "string"
},
"rowstyle1": {
"label": "行1 CSS样式",
"description": "应用到第1个内容行的CSS样式",
"type": "line"
},
},
"header1": {
"header1": {
"label": "数据头部 #1",
"label": "顶栏1",
"description": "占用1行空间, 居中对齐, 与 label#n, data#n 不兼容",
"description": "位于第1个内容行的顶栏。顶栏居中显示,占用一整行的空间。",
"type": "unbalanced-wikitext"
"type": "line"
},
},
"label1": {
"label1": {
"label": "数据标签 #1",
"label": "标签1",
"description": "和 data#n 一起定义时, 显示在左边。与 header#n 不兼容",
"description": "位于第1个内容行的标签。标签显示在信息框左侧,如果对应的数据没有内容,就不会显示。当同一行中同时存在顶栏,标签也不会显示。",
"type": "unbalanced-wikitext"
"type": "line"
},
},
"data1": {
"data1": {
"label": "数据 #1",
"label": "数据1",
"description": "和 label#n 一起定义时, 显示在右边。与 header#n 不兼容",
"description": "位于第1个内容行的数据。当对应标签存在时,数据显示在信息框右侧,对应标签不存在时,居中显示,占用一整行的空间。当同一行中同时存在顶栏时,数据不会显示。",
"type": "unbalanced-wikitext"
"type": "content"
},
},
"rowclass1": {
"rowclass2": {
"label": "行 #1 CSS类",
"label": "行2 HTML类",
"description": "作用于第n行的 CSS类",
"description": "添加到第2个内容行的HTML类",
"type": "string"
"type": "line"
},
},
"rowstyle1": {
"class2": {
"label": "行 #1 CSS样式",
"label": "数据2 HTML类",
"description": "作用于第n行的 CSS样式",
"description": "应用到数据2单元格的HTML类",
"type": "string"
"type": "string"
},
},
"class1": {
"rowstyle2": {
"description": "应用到 data (n) 单元格的 CSS类",
"label": "行2 CSS样式",
"type": "string"
"description": "应用到第2个内容行的CSS样式",
"type": "line"
},
},
"header2": {
"header2": {
"label": "数据头部 #2",
"label": "顶栏2",
"inherits": "header1"
"description": "位于第2个内容行的顶栏",
"type": "line"
},
},
"label2": {
"label2": {
"label": "数据标签 #2",
"label": "标签2",
"inherits": "label1"
"description": "位于第2个内容行的标签",
"type": "line"
},
},
"data2": {
"data2": {
"label": "数据 #2",
"label": "数据2",
"inherits": "data1"
"description": "位于第2个内容行的数据",
"type": "content"
},
},
"rowclass2": {
"rowclass3": {
"label": "行 #2 CSS类",
"label": "行3 HTML类",
"inherits": "rowclass1"
"description": "添加到第3个内容行的HTML类",
"type": "line"
},
},
        "rowstyle2": {
"class3": {
"label": "行 #2 CSS样式",
"label": "数据3 HTML类",
"inherits": "rowstyle1"
"description": "应用到数据3单元格的HTML类",
"type": "string"
},
},
"class2": {
"rowstyle3": {
"inherits": "class1"
"label": "行3 CSS样式",
"description": "应用到第3个内容行的CSS样式",
"type": "line"
},
},
"header3": {
"header3": {
"label": "数据头部 #3",
"label": "顶栏3",
"inherits": "header1"
"description": "位于第3个内容行的顶栏",
"type": "line"
},
},
"label3": {
"label3": {
"label": "数据标签 #3",
"label": "标签3",
"inherits": "label1"
"description": "位于第3个内容行的标签",
"type": "line"
},
},
"data3": {
"data3": {
"label": "数据 #3",
"label": "数据3",
"inherits": "data1"
"description": "位于第3个内容行的数据",
"type": "content"
},
},
"rowclass3": {
"rowclass4": {
"label": "行 #3 CSS类",
"label": "行4 HTML类",
"inherits": "rowclass1"
"description": "添加到第4个内容行的HTML类",
"type": "line"
},
},
"rowstyle3": {
"class4": {
"label": "行 #3 CSS样式",
"label": "数据4 HTML类",
"inherits": "rowstyle1"
"description": "应用到数据4单元格的HTML类",
"type": "string"
},
},
"class3": {
"rowstyle4": {
"inherits": "class1"
"label": "行4 CSS样式",
"description": "应用到第4个内容行的CSS样式",
"type": "line"
},
},
"header4": {
"header4": {
"label": "数据头部 #4",
"label": "顶栏4",
"inherits": "header1"
"description": "位于第4个内容行的顶栏",
"type": "line"
},
},
"label4": {
"label4": {
"label": "数据标签 #4",
"label": "标签4",
"inherits": "label1"
"description": "位于第4个内容行的标签",
"type": "line"
},
},
"data4": {
"data4": {
"label": "数据 #4",
"label": "数据4",
"inherits": "data1"
"description": "位于第4个内容行的数据",
"type": "content"
},
},
"rowclass4": {
"rowclass5": {
"label": "行 #4 CSS类",
"label": "行5 HTML类",
"inherits": "rowclass1"
"description": "添加到第5个内容行的HTML类,编号可以继续延长",
"type": "line"
},
},
"rowstyle4": {
"class5": {
"label": "行 #4 CSS样式",
"label": "数据5 HTML类",
"inherits": "rowstyle1"
"description": "应用到数据5单元格的HTML类,编号可以继续延长",
"type": "string"
},
},
"class4": {
"rowstyle5": {
"inherits": "class1"
"label": "行5 CSS样式",
"description": "应用到第5个内容行的CSS样式,编号可以继续延长",
"type": "line"
},
},
"header5": {
"header5": {
"label": "数据头部 #5",
"label": "顶栏5",
"inherits": "header1"
"description": "位于第5个内容行的顶栏,编号可以继续延长",
"type": "line"
},
},
"label5": {
"label5": {
"label": "数据标签 #5",
"label": "标签5",
"inherits": "label1"
"description": "位于第5个内容行的标签,编号可以继续延长",
"type": "line"
},
},
"data5": {
"data5": {
"label": "数据 #5",
"label": "数据5",
"inherits": "data1"
"description": "位于第5个内容行的数据,编号可以继续延长",
"type": "content"
},
},
"rowclass5": {
"belowclass": {
"label": "行 #5 CSS类",
"label": "底部单元格HTML类",
"inherits": "rowclass1"
"description": "添加到底部单元格的HTML类",
"type": "line"
},
},
"rowstyle5": {
"belowstyle": {
"label": "行 #5 CSS样式",
"label": "底部单元格CSS样式",
"inherits": "rowstyle1"
"description": "应用到底部单元格的CSS样式",
},
"type": "line"
"class5": {
"inherits": "class1"
},
"header6": {
"label": "数据头部 #6",
"inherits": "header1"
},
"label6": {
"label": "数据标签 #6",
"inherits": "label1"
},
"data6": {
"label": "数据 #6",
"inherits": "data1"
},
"rowclass6": {
"label": "行 #6 CSS类",
"inherits": "rowclass1"
},
"rowstyle6": {
"label": "行 #6 CSS样式",
"inherits": "rowstyle1"
},
"class6": {
"inherits": "class1"
},
"header7": {
"label": "数据头部 #7",
"inherits": "header1"
},
"label7": {
"label": "数据标签 #7",
"inherits": "label1"
},
"data7": {
"label": "数据 #7",
"inherits": "data1"
},
"rowclass7": {
"label": "行 #7 CSS类",
"inherits": "rowclass1"
},
"rowstyle7": {
"label": "行 #7 CSS样式",
"inherits": "rowstyle1"
},
"class7": {
"inherits": "class1"
},
"header8": {
"label": "数据头部 #8",
"inherits": "header1"
},
"label8": {
"label": "数据标签 #8",
"inherits": "label1"
},
"data8": {
"label": "数据 #8",
"inherits": "data1"
},
"rowclass8": {
"label": "行 #8 CSS类",
"inherits": "rowclass1"
},
"rowstyle8": {
"label": "行 #8 CSS样式",
"inherits": "rowstyle1"
},
"class8": {
"inherits": "class1"
},
},
"below": {
"below": {
"label": "底部单元格",
"label": "底部单元格",
"description": "一般用于放置参见、脚注等",
"description": "信息框最下方的单元格,一般用来添加脚注、另见和其他类似信息。"
"type": "unbalanced-wikitext"
}
}
},
},
"format": "{{_\n  | _ = _\n}}\n"
"format": "{{_\n  | _ = _\n}}",
"description": "本模板用于构建信息框。通常本模板不应直接在条目中使用,但若需要,可在一次性情况中直接使用。"
}
}
</templatedata>
</templatedata>


需要注意, 其中有一些参数可以无限延长, 如:
== 追踪分类 ==
* image(n)
* [[:Category:使用带有标题参数的嵌入式信息框模板的页面]]
* caption(n)
* [[:Category:使用无数据行信息框模板的条目]]
* header(n)
* [[:Category:使用已忽略数据行信息框模板的页面]]
* label(n)
 
* data(n)
* rowclass(n)
* class(n)
<noinclude>
== 另见 ==
== 另见 ==
* [[Module:Infobox]], 此模板所基于的Lua模块.
* [[Module:Infobox]] — 本模板基于的Lua模块
* [[Module:Check for unknown parameters]]
* [[Module:Check for unknown parameters]] — 用于检测未知参数的模块
* {{tl|Navbox}}和{{tl|Sidebar}}
* [[:Category:信息框模板]] — 所有信息框的总分类
* [[Module:InfoboxImage]] — 用于在信息框的任何位置放置图像


== 脚注 ==
<includeonly>
</noinclude>
{{Sandbox_other||
[[Category:信息框模板| ]]
}}
</includeonly>

2022年12月23日 (五) 18:08的最新版本

{{Infobox}}是构建信息框的元模板,它用来构建一个像{{Infobox 一些主题}}的模板,比如{{Infobox_settlement}}。

此模板是信息框的元模板:它用来构建其他信息框模板。注意:此模板通常不应直接在条目中使用,但若需要,可在一次性情况中直接使用。wikipedia:Help:Infobox中包含关于信息框内容和设计的介绍。wikipedia:Wikipedia:Manual_of_Styles/Infoboxes中包含附加格式指南。参见Category:信息框模板查看已有的信息框模板。

使用

对于{{Infobox 一些主题}},经过简化的模板代码看起像这样:

{{Infobox
  | name     = {{{name|{{PAGENAME}}}}}
  | image    = {{{image|}}}
  | caption1 = {{{caption|}}}

  | label1   = 前名
  |  data1   = {{{former_names|}}}

  | header2  = 一般信息

  | label3   = 状态
  |  data3   = {{{status|}}}
  ... <!-- etc. -->
}}

参数

可选控制参数

name
如果此参数存在,“查看·编辑·讨论”链接显示在信息框底部,链接指向此参数指定的页面。如果未在此参数中指定命名空间,则在链接前添加“Template:”(模板)前缀。可使用{{subst:PAGENAME}};但这不太可能是你希望的,因为点击链接的用户会被导向模板页面/代码,而不是他们可能希望更改的条目中的信息框数据。
child
详细信息参见嵌入一节。如果此参数设置为“yes”,这个子信息框应该含有标题,不含name参数。此参数默认为空。
subbox
详细信息参见子盒一节。如果此参数设置为“yes”,这个子信息框应该含有标题,不含name参数。此参数默认为空。
decat
如果此参数设置为“yes”,生成的信息框有问题,或不含有可见数据时,当前页面将不会被自动分类进维护分类中。此参数默认为空。
autoheaders
如果此参数设置为任意非空值,则后面没有data字段的header会被隐藏。详细信息参见“在下方所有数据字段都为空时隐藏顶栏”一节。

内容参数

标题

有两种不同的在信息框中放置标题的方法。一种会将标题放置在信息框表格内最上面的单元格,另一种放置在表格上方。你可以同时使用这两种方法,或只使用其中一种,或者——尽管不推荐——都不用:

title
放置在表格上方的标题文本(如果这是个子信息框,则作为整个表格内容的区域标题)
above
放置在表格内最上面单元格的文本。
subheadern
附加标题字段,显示在title和above之下,图像之上。

示例:

{{Infobox
  | name = Infobox/doc
  | title = 信息框上方的标题
  | subheader = 信息框的子标题
  | header = (信息框的其他部分)
}}
信息框上方的标题
信息框的子标题
{{Infobox
  | name = Infobox/doc
  | above = 信息框内最上方单元格的文本
  | subheader = 信息框的子标题
  | subheader2 = 信息框第2个子标题
  | header = (信息框的其他部分)
}}
信息框内最上方单元格的文本
信息框的子标题
信息框第2个子标题

插图

imagen
显示在模板顶部的图像。使用完整图像语法,例如[[File:Example.png|200px|alt=示例替代文本]]。图像默认居中。参见wikipedia:WP:ALT获取关于替代文本的更多信息。
captionn
图像下面的描述文本。

主要数据

headern
在第n行作为顶栏的文本。
labeln
在第n行作为标签的文本。
datan
在第n行显示为数据的文本。

注意:在单行(比如第n行)中,不是所有参数组合都可用。|headern=会与对应的|datan=(以及|labeln=|rowclassn=,见下)冲突,使得|datan=不会显示;缺少|datan=会隐藏对应的|labeln=。在单行中可用的组合有:

  • |classn= |headern=
  • |rowclassn= |classn= |datan=
  • |rowclassn= |labeln= |classn= |datan=

可在下方示例章节查看header4、label4和data4的显示情况。

编号范围

在顶栏和标签/数据行的编号中使用不连续编号可以在修改信息框时增加灵活性。之后如果需要插入新行,先前使用不连续编号的信息框就不用为已存在的所有参数重新编号了。例如:

  | header3  = 区域 1
  |  label5  = 标签 A
  |   data5  = 数据 A
  |  label7  = 标签 C
  |   data7  = 数据 C
  | header10 = 区域 2
  |  label12 = 标签 D
  |   data12 = 数据 D

也可以自动重新编号参数名,使用wikipedia:User:Frietjes/infoboxgap.js或者wikipedia:Module:IncrementParams

编号没有最大限制,但在两个编号之间最多只能相差50。

可选的数据字段

只有标签,没有数据的行不会显示。这样可以简单地创建选填的信息。要使一行可选,填写一个默认为空的数据参数就行,像这样:

  | label5 = 人口
  |  data5 = {{{population|}}}

这样的话,当条目未提供人口(|population=)参数时,信息框的这一行就不会显示。

对于带有预格式化(除了数据之外还有其他内容)内容的复杂字段,在没有指定参数时它依然会显示。你可以把参数和预设内容都放进“#if”语句里,这样在没有指定参数时,预设内容也不会显示。比如下面的示例中的“#if”语句:“#if(如果):指定了mass参数|显示mass参数,后跟‘ kg’”:

  | label6 = 质量
  |  data6 = {{ #if: {{{mass|}}} | {{{mass}}} kg }}

#if的更多信息可见于mw:Help:Extension:ParserFunctions##ifmetawikimedia:ParserFunctions##if:

在下方所有数据字段都为空时隐藏顶栏

也可以让顶栏只在其下方的某个或多个数据单元有内容时才显示。

考虑这种情况:

{{Infobox
  | title   = 示例:带或不带数据的顶栏
  | headerstyle = background: lightgrey;

  | header1 = 带有空区域的header1
  |  label2 = label2文本 |   data2 =
  |  label3 = label3文本 |   data3 =
  |  label4 = label4文本 |   data4 =

  | header5 = 带有下方数data的header5
  |  label6 = label6文本 |   data6 = 一些值
}}
示例:带或不带数据的顶栏
带有空区域的header1
带有下方data的header5
label6 文本一些值

如果你希望在|datan=没有值时隐藏顶栏,使用|autoheaders=y

{{Infobox
  | title = 示例:带或不带数据的顶栏
  | autoheaders = y
  | headerstyle = background: lightgrey;

  | header1 = 带有空区域的header1
  |  label2 = label2文本 |   data2 =
  |  label3 = label3文本 |   data3 =
  |  label4 = label4文本 |   data4 =

  | header5 = 带有下方data的header5
  |  label6 = label6文本 |   data6 = 一些值
}}
示例:带或不带数据的顶栏
带有下方data的header5
label6文本一些值

这样,header1会在data2、data3或data4中任意一个非空时显示。如果3个参数都为空,那么顶栏就不会显示,在到下一个可见内容之前也不会出现空行。

注意:如果数据含有空HTML元素,像|data=<span style="background: yellow;"></span>,那么这个数据会被视作非空(有数据)。

如果设置了|autoheader=y,但你不希望一些项触发顶栏,放置|headerX=。这会被当做空顶栏并分隔开它与后续项目。

{{Infobox
  | title   = 示例:带或不带数据的空顶栏
  | autoheaders = y
  | headerstyle = background: lightgrey;

  | header1 = 带有空区域的header1
  |  label2 = label2文本 |   data2 =
  |  label3 = label3文本 |   data3 =
  |  label4 = label4文本 |   data4 =

  | header5 = _BLANK_
  |  label6 = label6文本 |   data6 = 一些值,但不会触发header1或者显示header5
}}
示例:带或不带数据的空顶栏
label6文本一些值,但不会触发header1或者显示header5

信息框脚

below
放置在底部单元格的文本。底部单元格用于放置脚注、另见和其他类似信息。

显示参数

斜体标题

通过传递italic title参数,带有信息框条目的标题可显示为斜体,符合WP:ITALICTITLE

  • 在信息框中传递|italic title={{{italic title|}}}来启用斜体标题。
  • 传递|italic title={{{italic title|no}}}默认禁用斜体标题(特别是因为只有拉丁文字可以安全地以这种样式显示,而且可能需要斜体来区分外语和本地英语,而其他文字的斜体可能很难阅读),但可在一些情况下启用。
  • 不传递此参数来禁用全部斜体标题。

模板样式

模板样式参数|templatestyles=|child templatestyles=|grandchild templatestyles=接收模板样式页的名称(例如Template:Example/styles.css),并转换为模板样式标签(<templatestyles src="Template:Example/styles.css" /> )。模板样式在样式化信息框时更为强力。

一些使用规则: 始终在|bodyclass=中添加这个信息框独有的的类,这样添加到一个信息框的样式就不会“泄露”到另一个信息框中。例如,Template:Infobox_settlement含有.infobox-settlement类,信息框模板样式的所有CSS选择器都需要匹配这个类。

这些标签以这个顺序加载:

  1. 核心模板样式(Module:Infobox/styles.css
  2. 一般模板样式(|templatestyles=
  3. 子模板样式(|child templatestyles=
  4. 孙模板样式(|grandchild templatestyles=

因此,这些样式表可以“层叠”。

templatestyles
为直接调用{{Infobox}}的模板或模块添加的模板样式。
child templatestyles
在模板/模块调用的信息框已有|templatestyles=时,为模板/模块添加额外模板样式。
grandchild templatestyles
在模板/模块调用的信息框已有|child templatestyles=时,为模板/模块添加额外模板样式。
模板样式参数使用示例

一个无需支持子模板的信息框(无论是它没有子模板还是不想要子模板):

{{Infobox
  | title = {{{name|示例信息框}}}
  | bodyclass = infobox-example
  | templatestyles = Template:Infobox_example/styles.css
}}

一个需要支持子模板的信息框:

{{Infobox
  | title = {{{name|示例信息框}}}
  | bodyclass = infobox-example {{{class|}}}
  | templatestyles = Template:Infobox_example/styles.css
  | child templatestyles = {{{child templatestyles|}}}
}}

它的一个子信息框:

{{Infobox_example
  | title = {{{name|示例子信息框}}}
  | bodyclass = infobox-example-child
  | child templatestyles = Template:Infobox_example_child/styles.css
}}

这样子信息框可以添加它独有的类和模板样式,叠起来了!

支持孙模板的方法是类似的,模板需要额外传递|grandchild templatestyles=参数,而子模板也需要传递|bodyclass=|grandchild templatestyles=

CSS样式

bodystyle
应用到整个信息框表格
titlestyle
仅应用到表格上方的标题。添加背景颜色通常是不明智的,因为文本会显示在消息框
abovestyle
仅应用到信息框顶部单元格。默认样式有font-size: 125%;因为此单元格通常用于标题。如果你希望将此单元格的文本改为正常大小,在abovestyle里包含“font-size: 100%”。
subheaderstyle
应用到所有子标题单元格
imagestyle
应用到图像所在的单元格,包括图像描述。在设置图像描述的文本属性时应使用captionstyle,而不是imagestyle,以防止未来图像描述移出此单元格。
captionstyle
应用到图像描述文本。
rowstylen
此参数插入到指定行的style属性中。
headerstyle
应用到所有顶栏单元格
labelstyle
应用到所有标签单元格
datastyle
应用到所有数据单元格
belowstyle
仅应用到信息框底部单元格

HTML类和微格式

bodyclass
此参数插入到信息框(即<table class="infobox ...">…</table>)的class属性中。
titleclass
此参数插入到信息框外部标题class属性中。
aboveclass
此参数插入到信息框above单元格的class属性中。
subheaderrowclassn
此参数插入到子标题所在的整个表格行的class属性中。
subheaderclassn
此参数插入到信息框子标题class属性中。
imagerowclassn
此参数插入到图像所在的整个表格行的class属性中。
imageclass
此参数插入到图像class属性中。
rowclassn
此参数插入到指定行的class属性中,包括labeldata单元格。
classn
此参数插入到指定行中dataclass属性中。如果没有data单元格就不会生效。
belowclass
此参数插入到信息框below单元格的class属性中。

此模板支持附加微格式信息。这是通过为不同data单元格添加“class”属性来实现的,不同的class属性可以指示相关数据单元格包含何种类型的信息。可以指定多个类名,使用空格分隔,其中一些类作为CSS选择器,附加相关样式,另一些用于微格式。

要标记一个信息框包含hCard信息,作为示例,添加下方参数:

  | bodyclass = vcard

为于每行包含属于vcard一部分的data单元格,添加一个相应的class参数:

  | class1 = fn
  | class2 = org
  | class3 = tel

…等等。通常用于显示信息框主题的“above”和“title”也可以添加类。

可在wikipedia:Wikipedia:WikiProject Microformats获取在wiki内添加微格式信息的进一步信息,访问微格式官方网站亦能获取更一般性的信息。

示例

注意,当定义了标签但相关的数据单元格为空时,那一行不会显示在信息框中;在一行中同时定义了顶栏、标签和数据时,只有顶栏会显示。也要注意,子标题(subheader)默认不像用于分隔主要数据区域的顶栏(header)那样显示为粗体,因为子标题的角色像顶部单元格(above)。

{{Infobox
  | name = Infobox/doc
  | bodystyle =

  | titlestyle =
  | abovestyle = background: #cfc;
  | subheaderstyle =
  | title = 测试信息框
  | above = 顶部文本
  | subheader  = 图像上方的子标题
  | subheader2 = 第2个子标题

  | imagestyle =
  | captionstyle =
  | image   = [[File:Example.png|200px|alt=示例替代文本]]
  | caption = 显示在File:Example.png下方的描述

  | headerstyle = background: #ccf;
  | labelstyle  = background: #ddf;
  | datastyle   =

  | header1 = 独自定义的顶栏
  |  label1 =
  |   data1 =
  | header2 =
  |  label2 = 独自定义的标签,不会显示,只有对应的数据存在时才会显示
  |   data2 =
  | header3 =
  |  label3 =
  |   data3 = 独自定义的数据
  | header4 = 三项均有定义(顶栏)
  |  label4 = 不会显示(因为与顶栏的编号相同)
  |   data4 = 不会显示(因为与顶栏的编号相同)
  | header5 =
  |  label5 = 定义的标签和数据(标签)
  |   data5 = 定义的标签和数据(数据)

  | belowstyle = background: #ddf;
  | below = 底部文本
}}
测试信息框
顶部文本
图像上方的子标题
第2个子标题
示例替代文本
显示在File:Example.png下方的描述
独自定义的顶栏
独自定义的数据
三项均有定义(顶栏)
定义的标签和数据(标签)定义的标签和数据(数据)
底部文本

这个示例中,|bodystyle=|labelstyle=参数用来调整信息框宽度,并设定label一列的默认宽度:

{{Infobox
  | name = Infobox/doc
  | bodystyle = width: 20em;

  | titlestyle =
  | title = 测试信息框

  | headerstyle =
  | labelstyle  = width: 33%;
  | datastyle   =

  | header1 =
   | label1 = 标签1
   |  data1 = 数据1
  | header2 =
  |  label2 = 标签2
  |   data2 = 数据2
  | header3 =
  |  label3 = 标签3
  |   data3 = 数据3
  | header4 = 顶栏4
  |  label4 =
  |   data4 =
  | header5 =
  |  label5 = 标签5
  |   data5 = 数据5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  | belowstyle =
  | below = 底部文本
}}
测试信息框
标签1数据1
标签2数据2
标签3数据3
顶栏4
标签5数据5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
底部文本

嵌入

信息框可以通过使用|child=参数嵌入到另一个信息框中。这一功能可用于创建模块化信息框,或者创建逻辑定义更好的区域。很久之前,为了创建有超过99行内容的信息框,需要使用嵌入功能,但现在单一信息框没有行数限制了。

{{Infobox
  | title = 顶层标题
  | data1 = {{Infobox | decat = yes | child = yes
    | title = 第1个子部分
    | label1 = 标签1.1
    |  data1 = 数据1.1
  }}
  | data2 = {{Infobox | decat = yes | child = yes
    | title = 第2个子部分
    | label1 = 标签2.1
    |  data1 = 数据2.1
  }}
  | belowstyle =
  | below = 底部文本
}}
顶层标题
第1个子部分
标签1.1数据1.1
第2个子部分
标签2.1数据2.1
底部文本

注意,上例中,子信息框放置在数据字段中,而非顶栏字段。除非特别指定,否则子信息框标题不会显示为粗体。如需让子部分标题显示为粗体,除了使用CSS外,也可以考虑使用下面的方法:

{{Infobox
  | title = 顶层标题
  | header1 = 第1个子部分
  | data2 = {{Infobox | decat = yes | child = yes
    | label1 = 标签1.1
    |  data1 = 数据1.1
  }}
  | header3 = 第2个子部分
  | data4 = {{Infobox | decat = yes | child = yes
    | label1 = 标签2.1
    |  data1 = 数据2.1
  }}
  | belowstyle =
  | below = 底部文本
}}
顶层标题
第1个子部分
标签1.1数据1.1
第2个子部分
标签2.1数据2.1
底部文本

在不使用|title=且不在嵌入的信息框前面添加任何文本的话,可能会在子信息框前生成一个空表格行,在视觉上添加间隙。空表格行可以用|rowstylen=display: none;来隐藏,将n替换为数据行的编号。

wikipedia:Wikipedia:WikiProject Infoboxes/embed包含一些链接,指向使用嵌入到其他信息框的信息框的条目。

子盒

另一种嵌入方法是使用|subbox=yes,这种方法移除信息框外部边框,但保留嵌入信息框的内部结构。这种方法的一个特点是子、父信息框不必含有相同的结构,标签和数据字段在两个信息框之间也不会对齐,因为他们的父表格不相同。

{{Infobox
  | headerstyle = background-color: #eee;
  |  labelstyle = background-color: #eee;

  | header1 = 主 1
  | header2 = 主 2
  | data3 = {{Infobox | subbox = yes
    | headerstyle = background-color: #ccc;
    | labelstyle  = background-color: #ddd;

    | header1 = 子 3-1
    | header2 = 子 3-2
    |  label3 = 标签 3-3 | data3 = 数据 3-3
  }}
  | data4 = {{Infobox | subbox = yes
    | labelstyle  = background-color: #ccc;
    |  label1 = 标签 4-1 | data1 = 数据 4-1
  }}
  |  label5 = 标签 5 | data5 = 数据 5
  | header6 = 主 6
}}
主 1
主 2
子 3-1
子 3-2
标签 3-3数据 3-3
标签 4-1数据 4-1
标签 5数据 5
主 6

相似的嵌入技术可以用在其他生成表格的模板的内容参数(例如{{Sidebar}}):

{{Sidebar
  | navbar = off
  | headingstyle = background-color: #eee;
  | heading1 = 标题 1
  | heading2 = 标题 2
  | content3 = {{Infobox | subbox = yes
    | headerstyle = background-color:#ccc;
    | labelstyle = background-color:#ddd;
    | header1 = 子 3-1
    | header2 = 子 3-2
    |  label3 = 标签 3-3 | data3 = 数据 3-3
  }}
  | content4 = {{Infobox | subbox = yes
    | labelstyle = background-color: #ccc;
    |  label1 = 标签 4-1 | data1 = 数据 4-1
  }}
  | heading5 = 标题 5
}}

模板:Sidebar

包含每个子盒的父数据单元格的默认内边距依然可见,因此子盒比父盒略窄,并且父盒标准单元格之间的垂直间距比不同子盒单元格之间的垂直间距大。

在嵌入的不带点列表中控制换行

{{nbsp}}模板可以和{{wbr}}{{nowrap}}一起用来控制嵌入在信息框中的不带点列表的换行(例如:wikipedia:Template:Infobox film中的参演人员列表)。要防止包装的长实体和其他实体之间混淆,参见Template:Wbr/doc#控制信息框中的换行获取详情。

完整空白语法

注意:行编号是无限的,下面只提供20个编号,因为使用更大编号的信息框相对比较少见,在需要时扩展编号就行。微格式“class”参数也省略掉了,因为它们不太常用。

{{Infobox
  | name = {{subst:PAGENAME}}
  | child = {{{child|}}}
  | subbox = {{{subbox|}}}
  | italic title = {{{italic title|no}}}
  | templatestyles =
  | child templatestyles =
  | grandchild templatestyles =
  | bodystyle =

  | titlestyle =
  | abovestyle =
  | subheaderstyle =

  | title =
  | above =
  | subheader =

  | imagestyle   =
  | captionstyle =

  |   image  =
  | caption  =
  |   image2 =
  | caption2 =

  | headerstyle =
  |  labelstyle =
  |   datastyle =

  | header1  =
  |  label1  =
  |   data1  =
  | header2  =
  |  label2  =
  |   data2  =
  | header3  =
  |  label3  =
  |   data3  =
  | header4  =
  |  label4  =
  |   data4  =
  | header5  =
  |  label5  =
  |   data5  =
  | header6  =
  |  label6  =
  |   data6  =
  | header7  =
  |  label7  =
  |   data7  =
  | header8  =
  |  label8  =
  |   data8  =
  | header9  =
  |  label9  =
  |   data9  =
  | header10 =
  |  label10 =
  |   data10 =
  | header11 =
  |  label11 =
  |   data11 =
  | header12 =
  |  label12 =
  |   data12 =
  | header13 =
  |  label13 =
  |   data13 =
  | header14 =
  |  label14 =
  |   data14 =
  | header15 =
  |  label15 =
  |   data15 =
  | header16 =
  |  label16 =
  |   data16 =
  | header17 =
  |  label17 =
  |   data17 =
  | header18 =
  |  label18 =
  |   data18 =
  | header19 =
  |  label19 =
  |   data19 =
  | header20 =
  |  label20 =
  |   data20 =

  | belowstyle =
  | below =
}}

移植到其他MediaWiki

{{Infobox}}依赖于mw:Extension:Scribuntomw:Extension:TemplateStyles扩展,mw:Extension:ParserFunction扩展很可能也是必需的,所以目标MediaWiki需要安装这三个扩展。你需要复制以下页面:

Lua模块也有自己的依赖项,全复制过去。

模板数据

这是用于新版可视化编辑器及其他工具的模板数据文档。

Infobox模板数据

本模板用于构建信息框。通常本模板不应直接在条目中使用,但若需要,可在一次性情况中直接使用。

模板参数

此模板有自定义格式。

参数描述类型状态
名称name

信息框底部“查看·编辑·讨论”链接指向模板的名称,如果不指定命名空间,会在链接前添加“Template:”(模板)前缀。

自动值
{{subst:PAGENAME}}
单行文本可选
子盒式child

模板是否以子盒格式显示

布尔可选
嵌入式embed

模板是否以嵌入格式显示

布尔可选
禁用分类decat

模板是否会禁用维护分类

布尔可选
斜体标题italic title

启用后页面标题会变为斜体

布尔弃用
自动顶栏autoheaders

启用本功能的话,下方没有非空数据字段的顶栏都会被隐藏。

布尔可选
模板样式templatestyles

信息框需要加载的模板样式

示例值
Template:Infobox_exmaple/styles.css
单行文本可选
子模板样式child templatestyles

子模板加载的模板样式,重复示例中的值就行。使用此功能也需要为bodyclass参数的最后一个类后面添加{{{bodyclass|}}},例如“bodyclass = infobox-example {{{bodyclass|}}}”。

示例值
{{{child templatestyles|}}}
单行文本可选
孙模板样式grandchild templatestyles

孙模板加载的模板样式,重复示例中的值就行。详情参见模板文档的“模板样式”一节。

示例值
{{{grand templatestyles|}}}
单行文本可选
整体HTML类bodyclass

添加到信息框整体的HTML类

示例值
infobox-settlement vcard
单行文本可选
整体CSS样式bodystyle

应用到信息框整体的CSS样式

示例值
float: none;
字符串可选
标题HTML类titleclass

添加到信息框外部标题的HTML类

单行文本可选
顶部单元格HTML类aboveclass

添加到顶部单元格的HTML类

字符串可选
子标题2表格行HTML类subheaderrowclass2

添加到子标题2所处表格行的HTML类,编号可以继续延长

单行文本可选
子标题2 HTML类subheaderclass2

添加到子标题2单元格的HTML类,编号可以继续延长

单行文本可选
标题CSS样式titlestyle

应用到信息框外部标题的CSS样式

字符串可选
顶部单元格CSS样式abovestyle

应用到顶部单元格的CSS样式

单行文本可选
子标题CSS样式subheaderstyle

应用到所有子标题的CSS样式

未知可选
标题title

信息框外部标题

内容可选
顶部单元格above

信息框最上方的单元格(内部标题)

内容可选
子标题1subheader subheader1

信息框的第1个子标题

内容可选
子标题1表格行HTML类subheaderrowclass subheaderrowclass1

添加到子标题1所处表格行的HTML类

单行文本可选
子标题1 HTML类subheaderclass subheaderclass1

添加到子标题1单元格的HTML类

单行文本可选
子标题2subheader2

信息框的第2个子标题,编号可以继续延长

内容可选
图像1表格行HTML类imagerowclass imagerowclass1

添加到图像1所处表格行的HTML类

单行文本可选
图像2表格行HTML类imagerowclass2

添加到图像2所处表格行的HTML类

单行文本可选
图像HTML类imageclass

添加到所有图像单元格的HTML类

单行文本可选
图像CSS样式imagestyle

应用到所有图像单元格的CSS样式

单行文本可选
图像描述CSS样式captionstyle

应用到所有图像描述文本的CSS样式

单行文本可选
图像1image image1

第1张图像,信息框图像显示在子标题下。图像使用完整wikitext图像语法。

示例值
[[File:Example.png|200px|替代文本]]
单行文本可选
图像描述1caption caption1

图像1的描述文本

内容可选
图像2image2

第2张图像,编号可以继续延长

单行文本可选
图像描述2caption2

图像2的描述文本,编号可以继续延长

内容可选
顶栏CSS样式headerstyle

应用到所有顶栏单元格的CSS样式

单行文本可选
标签CSS样式labelstyle

应用到所有标签单元格的CSS样式

单行文本可选
数据CSS样式datastyle

应用到所有数据单元格的CSS样式

单行文本可选
行1 HTML类rowclass1

添加到第1个内容行的HTML类

单行文本可选
数据1 HTML类class1

应用到数据1单元格的HTML类

字符串可选
行1 CSS样式rowstyle1

应用到第1个内容行的CSS样式

单行文本可选
顶栏1header1

位于第1个内容行的顶栏。顶栏居中显示,占用一整行的空间。

单行文本可选
标签1label1

位于第1个内容行的标签。标签显示在信息框左侧,如果对应的数据没有内容,就不会显示。当同一行中同时存在顶栏,标签也不会显示。

单行文本可选
数据1data1

位于第1个内容行的数据。当对应标签存在时,数据显示在信息框右侧,对应标签不存在时,居中显示,占用一整行的空间。当同一行中同时存在顶栏时,数据不会显示。

内容可选
行2 HTML类rowclass2

添加到第2个内容行的HTML类

单行文本可选
数据2 HTML类class2

应用到数据2单元格的HTML类

字符串可选
行2 CSS样式rowstyle2

应用到第2个内容行的CSS样式

单行文本可选
顶栏2header2

位于第2个内容行的顶栏

单行文本可选
标签2label2

位于第2个内容行的标签

单行文本可选
数据2data2

位于第2个内容行的数据

内容可选
行3 HTML类rowclass3

添加到第3个内容行的HTML类

单行文本可选
数据3 HTML类class3

应用到数据3单元格的HTML类

字符串可选
行3 CSS样式rowstyle3

应用到第3个内容行的CSS样式

单行文本可选
顶栏3header3

位于第3个内容行的顶栏

单行文本可选
标签3label3

位于第3个内容行的标签

单行文本可选
数据3data3

位于第3个内容行的数据

内容可选
行4 HTML类rowclass4

添加到第4个内容行的HTML类

单行文本可选
数据4 HTML类class4

应用到数据4单元格的HTML类

字符串可选
行4 CSS样式rowstyle4

应用到第4个内容行的CSS样式

单行文本可选
顶栏4header4

位于第4个内容行的顶栏

单行文本可选
标签4label4

位于第4个内容行的标签

单行文本可选
数据4data4

位于第4个内容行的数据

内容可选
行5 HTML类rowclass5

添加到第5个内容行的HTML类,编号可以继续延长

单行文本可选
数据5 HTML类class5

应用到数据5单元格的HTML类,编号可以继续延长

字符串可选
行5 CSS样式rowstyle5

应用到第5个内容行的CSS样式,编号可以继续延长

单行文本可选
顶栏5header5

位于第5个内容行的顶栏,编号可以继续延长

单行文本可选
标签5label5

位于第5个内容行的标签,编号可以继续延长

单行文本可选
数据5data5

位于第5个内容行的数据,编号可以继续延长

内容可选
底部单元格HTML类belowclass

添加到底部单元格的HTML类

单行文本可选
底部单元格CSS样式belowstyle

应用到底部单元格的CSS样式

单行文本可选
底部单元格below

信息框最下方的单元格,一般用来添加脚注、另见和其他类似信息。

未知可选

追踪分类

另见