模板:Aligned table/doc:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“The purpose is of this template is for generating simple tables in locations where standard table markup is either not possible, without significant u…”
 
Kangkk​(留言 | 贡献)
无编辑摘要
 
第1行: 第1行:
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 {{tld|!}} 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}}.
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.
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.
第61行: 第61行:


  | fullwidth
  | fullwidth
  | {{nowrap|If set (to anything, "on", "true", "yes", etc.), ensures table spans entire width available.}}
  | 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.)
(Effect is to remove border-spacing and add width:100% to the table's styling.)
第74行: 第74行:
  | style
  | style
  | [[CSS styling]] applied to the table.
  | [[CSS styling]] applied to the table.
  | <code>{{nowrap|<nowiki> |style=width:80%;background:transparent; </nowiki>}}</code>
  | <code>nowiki> |style=width:80%;background:transparent; </nowiki></code>
  | ''Not set''
  | ''Not set''


第103行: 第103行:
  | ''Not set''
  | ''Not set''


  | col{{var|C}}width
  | colwidth
  | CSS width property of cell in column {{var|C}} (or include "width:...;" in <kbd>col{{var|C}}style</kbd>).
  | CSS width property of cell in column (or include "width:...;" in <kbd>colstyle</kbd>).
  | <code><nowiki> |col2width=9.0em &nbsp; |col3width=35%</nowiki></code>
  | <code><nowiki> |col2width=9.0em &nbsp; |col3width=35%</nowiki></code>
  | ''Not set''
  | ''Not set''


  | col{{var|C}}class
  | colclass
  | Classes added to cell in column {{var|C}}.
  | Classes added to cell in column .
  | <code><nowiki> |col1class=navbox-group </nowiki></code>
  | <code><nowiki> |col1class=navbox-group </nowiki></code>
  | '' Not set''
  | '' Not set''


  | col{{var|C}}align
  | colalign
  | CSS text-align property (left{{\}}right{{\}}center) of cell in column {{var|C}}'s cell contents (or include "text-align:...;" in <kbd>col{{var|C}}style</kbd>).
  | 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>
  | <code><nowiki> |col4align=right </nowiki></code>
  | ''Not set''
  | ''Not set''


  | col{{var|C}}nowrap
  | colnowrap
  | If set (to anything, "on", "true", "yes", etc.) adds "white-space:nowrap;" to the CSS style of cell in column {{var|C}} (i.e., to prevent lines within its cells from wrapping; or include "nowrap" in <kbd>col{{var|C}}class</kbd> or "white-space:nowrap;" in <kbd>col{{var|C}}style</kbd>).
  | 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>
  | <code><nowiki> |col5nowrap=on </nowiki></code>
  |  
  |  


  | col{{var|C}}style
  | colstyle
  | CSS style appended to cell in column {{var|C}}.
  | CSS style appended to cell in column .
  | <code><nowiki> |col4style=font-style:italic; </nowiki></code>
  | <code><nowiki> |col4style=font-style:italic; </nowiki></code>
  | ''Not set''
  | ''Not set''




  | col{{var|C}}header
  | colheader
  | If set (to any value), changes cells in column {{var|C}} to table headers (headings).
  | If set (to any value), changes cells in column to table headers (headings).
  | <code><nowiki> |col1header=on </nowiki></code>
  | <code><nowiki> |col1header=on </nowiki></code>
  | ''Not set''
  | ''Not set''
第151行: 第151行:


  <!--------Cells--------->
  <!--------Cells--------->
  | class{{var|R}}.{{var|C}}
  | class{{var|R}}.
  | Classes applied to cell in row {{var|R}}, column {{var|C}}. Overrides any other class attributions (<kbd>row{{var|R}}class</kbd>, <kbd>col{{var|C}}class</kbd>).
  | 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>
  | <code><nowiki> |class1.2=adr </nowiki></code>
  | ''Not set''
  | ''Not set''


  | style{{var|R}}.{{var|C}}
  | style{{var|R}}.
  | CSS styling applied to cell in row {{var|R}}, column {{var|C}}. Overrides any more general styling (<kbd>leftright</kbd>, <kbd>col{{var|C}}align</kbd>, <kbd>row{{var|R}}style</kbd>, etc).
  | 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>
  | <code><nowiki> |style5.3=text-align:right; </nowiki></code>
  | ''Not set''
  | ''Not set''


  | {{sans-serif|''Unnamed parameters''}}
  | ''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.
  | 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>
  | <code>{{!}} Azerbaijan {{!}} Malta {{!}} Zaire</code>