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

From blackwiki
Jump to navigation Jump to search
m (63 revisions imported)
 
(12 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
{{Lua|icononly=on |Module:Aligned table}}
 
{{Lua|icononly=on |Module:Aligned table}}
{{high-use|6000+}}
+
{{high-use|8130}}
 
<!----Please place categories where indicated at the bottom of this page and interwikis in Wikidata---->
 
<!----Please place categories where indicated at the bottom of this page and interwikis in Wikidata---->
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 complimentary 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 {{tlc|!}} 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.
Line 19: Line 19:
 
| colwidth =
 
| colwidth =
 
| leftright =
 
| leftright =
 +
| rightleft =
 
| colstyle =
 
| colstyle =
 
| rowstyle =
 
| rowstyle =
Line 44: Line 45:
  
 
== Parameters ==
 
== Parameters ==
 
+
<div style="overflow:auto;">
 
{{Aligned table
 
{{Aligned table
 
  |cols=4 |class=wikitable |style=line-height:1.35em;
 
  |cols=4 |class=wikitable |style=line-height:1.35em;
Line 88: Line 89:
 
  | 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 99: Line 100:
 
  | If set (to anything, "on", "true", "yes", etc.) is equivalent to <kbd><nowiki>|col1align=left</nowiki></kbd> and <kbd><nowiki>|col2align=right</nowiki></kbd>
 
  | 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>
 
  | <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''
 
  | ''Not set''
  
 
  | 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 128:
  
 
  | 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 142:
 
  | 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
Line 163: Line 169:
 
  | <code>{{!}} Azerbaijan {{!}} Malta {{!}} Zaire</code>
 
  | <code>{{!}} Azerbaijan {{!}} Malta {{!}} Zaire</code>
 
  | ''Not set''
 
  | ''Not set''
}}
+
}}</div>
  
 
== Examples ==
 
== Examples ==
Line 229: Line 235:
 
}}
 
}}
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
+
<pre>
| <!-- Categories below this line, please; interwikis to Wikidata. -->
+
{{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
 +
}}
 +
<includeonly>{{Sandbox other||
 
[[Category:Table templates]]
 
[[Category:Table templates]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 11:04, 20 October 2020

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 complementary 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 =
| 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) | ... | ...
}}

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".

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

Script error: No such module "aligned table".