查看“︁模板:Aligned table/doc”︁的源代码
来自康健生活
←
模板:Aligned table/doc
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
The purpose is of this template is for generating simple tables in locations where [[Help:Table|standard table markup]] is either not possible, without significant use of the <nowiki>{{!}}</nowiki> magic word (e.g., with a {{tl|sidebar}} template), or cumbersome (due to the repetitive use of specification of the same style statement in each row). This template should <u>not</u> be used to replace [[Help:Table|standard table markup]] in articles. This template is meant to be complementary to {{tl|infobox}} or {{tl|sidebar}}, and <u>not</u> a replacement for {{tl|infobox}} or {{tl|sidebar}}. A simpler method to include a table in a template that does not directly support table markup is to create the table in a sub-template using standard markup and transclude it. == Full syntax == For parameter explanations, see table below. <pre style="overflow:auto;"> {{Aligned table | cols = | fullwidth = | class = | style = | colwidth = | leftright = | rightleft = | colstyle = | rowstyle = <!--for Cth column:--> | colCwidth = | colCclass = | colCalign = | colCstyle = | colCnowrap = <!--for Rth row:--> | rowRclass = | rowRstyle = | rowRheader = <!--for cell R,C:--> | classR.C = | styleR.C = | (cell 1,1) | (cell 1,2) | ... | ... | (cell 2,1) | (cell 2,2) | ... | ... }} </pre> == Parameters == <div style="overflow:auto;"> {{Aligned table |cols=4 |class=wikitable |style=line-height:1.35em; |colstyle=padding-right:1.0em; |col2width=40.0em |col4style=padding-left:1.0em;text-align:center; |row1header=on | Parameter | Description | Examples | Default <!-------Overall--------> | cols | Number of columns in the table. | <code><nowiki> |cols=4 </nowiki></code> | 2 | fullwidth | If set (to anything, "on", "true", "yes", etc.), ensures table spans entire width available. (Effect is to remove border-spacing and add width:100% to the table's styling.) | <code><nowiki> |fullwidth=on </nowiki></code> | ''Not set'' | class | CSS/[[HTML attribute|HTML class]]/es applied to the table. | <code><nowiki> |class=wikitable |class=infobox</nowiki><br /><nowiki>|class=sortable nowrap |class=sidebar</nowiki></code> | ''Not set'' | style | [[CSS styling]] applied to the table. | <code>nowiki> |style=width:80%;background:transparent; </nowiki></code> | ''Not set'' | colwidth | Width of each column (or include "width:...;" in <kbd>colstyle</kbd>). | <code><nowiki> |colwidth=6.0em |colwidth=25%</nowiki></code> | ''Not set'' | colstyle | CSS styling prepended to the cell style for each column. | <code><nowiki> |colstyle=background:transparent; </nowiki></code> | ''Not set'' | rowstyle | CSS styling applied to each row. | <code><nowiki> |rowstyle=text-align:center; </nowiki></code> | vertical-align:top; <!-------Columns--------> | leftright | If set (to anything, "on", "true", "yes", etc.) is equivalent to <kbd><nowiki>|col1align=left</nowiki></kbd> and <kbd><nowiki>|col2align=right</nowiki></kbd> | <code><nowiki> |leftright=on </nowiki></code> | ''Not set'' | rightleft | If set (to anything, "on", "true", "yes", etc.) is equivalent to <kbd><nowiki>|col1align=right</nowiki></kbd> and <kbd><nowiki>|col2align=left</nowiki></kbd> | <code><nowiki> |rightleft=on </nowiki></code> | ''Not set'' | colwidth | CSS width property of cell in column (or include "width:...;" in <kbd>colstyle</kbd>). | <code><nowiki> |col2width=9.0em |col3width=35%</nowiki></code> | ''Not set'' | colclass | Classes added to cell in column . | <code><nowiki> |col1class=navbox-group </nowiki></code> | '' Not set'' | colalign | CSS text-align property (left / right / center) of cell in column 's cell contents (or include "text-align:...;" in <kbd>colstyle</kbd>). | <code><nowiki> |col4align=right </nowiki></code> | ''Not set'' | colnowrap | If set (to anything, "on", "true", "yes", etc.) adds "white-space:nowrap;" to the CSS style of cell in column (i.e., to prevent lines within its cells from wrapping; or include "nowrap" in <kbd>colclass</kbd> or "white-space:nowrap;" in <kbd>colstyle</kbd>). | <code><nowiki> |col5nowrap=on </nowiki></code> | | colstyle | CSS style appended to cell in column . | <code><nowiki> |col4style=font-style:italic; </nowiki></code> | ''Not set'' | colheader | If set (to any value), changes cells in column to table headers (headings). | <code><nowiki> |col1header=on </nowiki></code> | ''Not set'' <!--------Rows----------> | row{{var|R}}class | Classes applied to row {{var|R}}. | <code><nowiki> |row10class=navbox-abovebelow </nowiki></code> | ''Not set'' | row{{var|R}}style | CSS styling applied to row {{var|R}}. | <code><nowiki> |row2style=font-weight:bold; </nowiki></code> | | row{{var|R}}header | If set (to any value), changes cells in row {{var|R}} to table headers (headings). | <code><nowiki> |row1header=on </nowiki></code> | ''Not set'' <!--------Cells---------> | class{{var|R}}. | Classes applied to cell in row {{var|R}}, column . Overrides any other class attributions (<kbd>row{{var|R}}class</kbd>, <kbd>colclass</kbd>). | <code><nowiki> |class1.2=adr </nowiki></code> | ''Not set'' | style{{var|R}}. | CSS styling applied to cell in row {{var|R}}, column . Overrides any more general styling (<kbd>leftright</kbd>, <kbd>colalign</kbd>, <kbd>row{{var|R}}style</kbd>, etc). | <code><nowiki> |style5.3=text-align:right; </nowiki></code> | ''Not set'' | ''Unnamed parameters'' | Each unnamed parameter is taken to be the next cell in the table, starting at the table's top left corner and working left to right from top to bottom. | <code>{{!}} Azerbaijan {{!}} Malta {{!}} Zaire</code> | ''Not set'' }}</div> == Examples == <pre> {{Aligned table |cols=3 |class=wikitable | A | 1 | a | B | 2 | b }} </pre> {{Aligned table |cols=3 |class=wikitable | A | 1 | a | B | 2 | b }} <pre> {{Aligned table |cols=4 |class=wikitable |col1align=center |col2align=center |col3align=right |col4align=right | AAA | aa | 123 | 12345 | B | bbbbb | 1234 | 2 }} </pre> {{Aligned table |cols=4 |class=wikitable |col1align=center |col2align=center |col3align=right |col4align=right | AAA | aa | 123 | 12345 | B | bbbbb | 1234 | 2 }} <pre> {{Aligned table |class=wikitable |style=width:20em; |col1align=center |col2align=right | AAA | 123 | B | 2 }} </pre> {{Aligned table |class=wikitable |style=width:20em; |col1align=center |col2align=right | AAA | 123 | B | 2 }} <pre> {{Aligned table |cols=3 |class=wikitable sortable |row1header=y | U | # | l | A | 1 | a | B | 2 | b }} </pre> {{Aligned table |cols=3 |class=wikitable sortable |row1header=y | U | # | l | A | 1 | a | B | 2 | b }} <pre> {{Aligned table |cols=3 |class=wikitable sortable |row1header=y | U | # | l | A | 1 | a | B | 2 | b | | | | C | 3 | c }} </pre> {{Aligned table |cols=3 |class=wikitable sortable |row1header=y | U | # | l | A | 1 | a | B | 2 | b | | | | C | 3 | c }} <!-- 本行下加入模板(Documentation)的分类 --> <includeonly>[[Category:工具模板]]</includeonly> <!-- 本行下加入模板的子页面(Documentation/doc)分类 --> <noinclude>[[Category:模板说明文件]]</noinclude>
此页面嵌入的页面:
模板:Aligned table
(
查看源代码
)
模板:Tl
(
查看源代码
)
模板:Var
(
查看源代码
)
模块:Aligned table
(
查看源代码
)
返回
模板:Aligned table/doc
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。