Difference between revisions of "Template:Aligned table/doc"

From blackwiki
Jump to navigation Jump to search
Line 88: Line 88:
 
  | CSS styling prepended to the cell style for each column.
 
  | CSS styling prepended to the cell style for each column.
 
  | <code><nowiki> |colstyle=background:transparent; </nowiki></code>
 
  | <code><nowiki> |colstyle=background:transparent; </nowiki></code>
  | ''Empty''
+
  | ''Not set''
  
 
  | rowstyle
 
  | rowstyle
Line 102: Line 102:
  
 
  | col{{var|C}}width
 
  | col{{var|C}}width
  | CSS width property of cell in column number {{var|C}} (or include "width:...;" in <kbd>col{{var|C}}style</kbd>).
+
  | CSS width property of cell in column {{var|C}} (or include "width:...;" in <kbd>col{{var|C}}style</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
 
  | col{{var|C}}class
  | Classes added to cell in column number {{var|C}}.
+
  | Classes added to cell in column {{var|C}}.
 
  | <code><nowiki> |col1class=navbox-group </nowiki></code>
 
  | <code><nowiki> |col1class=navbox-group </nowiki></code>
 
  | '' Not set''
 
  | '' Not set''
Line 122: Line 122:
  
 
  | col{{var|C}}style
 
  | col{{var|C}}style
  | CSS style appended to cell in column number {{var|C}}.
+
  | CSS style appended to cell in column {{var|C}}.
 
  | <code><nowiki> |col4style=font-style:italic; </nowiki></code>
 
  | <code><nowiki> |col4style=font-style:italic; </nowiki></code>
 
  | ''Not set''
 
  | ''Not set''
Line 136: Line 136:
 
  | Classes applied to row {{var|R}}.
 
  | Classes applied to row {{var|R}}.
 
  | <code><nowiki> |row10class=navbox-abovebelow </nowiki></code>
 
  | <code><nowiki> |row10class=navbox-abovebelow </nowiki></code>
  | ''none set''
+
  | ''Not set''
  
 
  | row{{var|R}}style
 
  | row{{var|R}}style

Revision as of 00:48, 11 June 2016

The purpose is of this template is for generating simple tables in locations where standard table markup is either not possible, without significant use of the {{!}} magic word (e.g., with a {{sidebar}} template), or cumbersome (due to the repetitive use of specification of the same style statement in each row). This template should not be used to replace standard table markup in articles. This template is meant to be complimentary to {{infobox}} or {{sidebar}}, and not a replacement for {{infobox}} or {{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.

{{Aligned table
| cols =
| fullwidth =
| class =
| style =
| colwidth =
| leftright =
| 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) | ... | ...
}}

Parameters

Script error: No such module "aligned table".

Examples

{{Aligned table
|cols=3 |class=wikitable
| A | 1 | a
| B | 2 | b
}}

Script error: No such module "aligned table".

{{Aligned table
|cols=4 |class=wikitable
|col1align=center |col2align=center
|col3align=right  |col4align=right
| AAA | aa    | 123  | 12345
| B   | bbbbb | 1234 | 2
}}

Script error: No such module "aligned table".

{{Aligned table
|class=wikitable |style=width:20em;
|col1align=center |col2align=right
| AAA | 123
| B   | 2
}}

Script error: No such module "aligned table".

{{Aligned table
|cols=3 |class=wikitable sortable
|row1header=y
| U | # | l
| A | 1 | a
| B | 2 | b
}}

Script error: No such module "aligned table".