Difference between revisions of "Template:Aligned table/doc"
blackwiki>SMcCandlish (→Parameters: markup clean-up) |
blackwiki>SMcCandlish (markup clean-up) |
||
| Line 104: | Line 104: | ||
| ''not set'' | | ''not set'' | ||
| − | | col | + | | col{{var|C}}width |
| − | | Width of column number | + | | Width of column number {{var|C}} (or include "width:...;" in <kbd>col{{var|C}}style</kbd>). |
| <code><nowiki> |col2width=9.0em |col3width=35%</nowiki></code> | | <code><nowiki> |col2width=9.0em |col3width=35%</nowiki></code> | ||
| ''none set'' | | ''none set'' | ||
| − | | col | + | | col{{var|C}}class |
| − | | Class/es applied to column number | + | | Class/es applied to column number {{var|C}}. |
| <code><nowiki> |col1class=navbox-group </nowiki></code> | | <code><nowiki> |col1class=navbox-group </nowiki></code> | ||
| " | | " | ||
| − | | col | + | | col{{var|C}}align |
| − | | Alignment (left{{\}}right{{\}}center) for column | + | | Alignment (left{{\}}right{{\}}center) for column {{var|C}}'s cell contents (or include "text-align:...;" in <kbd>col{{var|C}}style</kbd>). |
| <code><nowiki> |col4align=right </nowiki></code> | | <code><nowiki> |col4align=right </nowiki></code> | ||
| ''none set'' | | ''none set'' | ||
| − | | col | + | | col{{var|C}}nowrap |
| − | | Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column | + | | Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column {{var|C}}'s cell styling (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>). |
| <code><nowiki> |col5nowrap=on </nowiki></code> | | <code><nowiki> |col5nowrap=on </nowiki></code> | ||
| " | | " | ||
| − | | col | + | | col{{var|C}}style |
| − | | CSS styling applied to column number | + | | CSS styling applied to column number {{var|C}}. |
| <code><nowiki> |col4style=font-style:italic; </nowiki></code> | | <code><nowiki> |col4style=font-style:italic; </nowiki></code> | ||
| " | | " | ||
<!--------Rows----------> | <!--------Rows----------> | ||
| − | | row | + | | row{{var|R}}class |
| − | | Class/es applied to row number | + | | Class/es applied to row number {{var|R}}. |
| <code><nowiki> |row10class=navbox-abovebelow </nowiki></code> | | <code><nowiki> |row10class=navbox-abovebelow </nowiki></code> | ||
| ''none set'' | | ''none set'' | ||
| − | | row | + | | row{{var|R}}style |
| − | | CSS styling applied to row number | + | | CSS styling applied to row number {{var|R}}. |
| <code><nowiki> |row2style=font-weight:bold; </nowiki></code> | | <code><nowiki> |row2style=font-weight:bold; </nowiki></code> | ||
| " | | " | ||
| − | | row | + | | row{{var|R}}header |
| Set to any value (e.g. <code>Y</code>) to change row's cells from data cells to table headers (headings). | | Set to any value (e.g. <code>Y</code>) to change row's cells from data cells to table headers (headings). | ||
| <code><nowiki> |row1header=on </nowiki></code> | | <code><nowiki> |row1header=on </nowiki></code> | ||
| Line 146: | Line 146: | ||
<!--------Cells---------> | <!--------Cells---------> | ||
| − | | class | + | | class{{var|R}}.{{var|C}} |
| − | | Class/es applied to cell in row | + | | Class/es 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>). |
| <code><nowiki> |class1.2=adr </nowiki></code> | | <code><nowiki> |class1.2=adr </nowiki></code> | ||
| ''none set'' | | ''none set'' | ||
| − | | style | + | | style{{var|R}}.{{var|C}} |
| − | | CSS styling applied to cell in row | + | | 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). |
| <code><nowiki> |style5.3=text-align:right; </nowiki></code> | | <code><nowiki> |style5.3=text-align:right; </nowiki></code> | ||
| " | | " | ||
Revision as of 18:39, 18 July 2015
| This is a documentation subpage for Template:Aligned table. It contains usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
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 =
<!--| colclass = -->
| 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".