İçeriğe atla

Şablon:Hizalı tablo

Vikikaynak, özgür kütüphane
Şablon belgelemesi Belgeleme


Known limitations

  • It is not currently recommended to combine use of this template with conventional table syntax due to differing approaches.
  • It is not possible to use a custom header line which contains rowspan elements.
  • When used in a multi-page transclusion (see usage notes below) , no indvidual page numbers will be displayed next to the relevant table portions,

(owing to interaction limitations with Proofread Page and LST).

Full syntax

For parameter explanations, see table below.

{{Aligned table
| cols =
| fullwidth =
| class =
| style =
| colwidth =
| leftright =
| colstyle =
| colalign =
| rowstyle =
| title =
| titlestyle =
| above =
| abovestyle =
| nobody =
| nofooter =
| noheader =

<!--for Cth column:-->
| colCwidth =
| colwidthC =
| colCclass =
| colclassC =
| classC =
| colCalign =
| alignC =
| colCstyle =
| colstyleC =
| styleC =
| colCnowrap =
| colnowrapC =
| nowrapC =
| colCheader =

<!--for Rth row:-->
| rowRclass =
| rowclassR =
| rowRstyle =
| rowstyleR =
| rowRheader =
| aboveR =
| aboveRnormal =
| aboveRclass =
| aboveRstyle =

<!--for cell R,C:-->
| classR.C =
| styleR.C =

| (cell 1,1) | (cell 1,2) | ... | ...
| (cell 2,1) | (cell 2,2) | ... | ...
}}

Usage over multiple Page:

First Page (content) :

{{Aligned table
| nofooter=yes <!--  required if data extends over more than one page. -->
| row1header=yes <!-- to mark first row as the headers.  -->
| (cell 1,1) | (cell 1,2) | ... | ...
| (cell 2,1) | (cell 2,2) | ... | ...
}}

First Page (footer) :

{{Aligned table|noheader=yes|nobody=yes}}

Continuing pages (header):

{{Aligned table
| nofooter=yes <!--  required if data extends over more than one page.-->
| row1header=yes <!-- to mark first row as the headers.  -->
| (header call 1,1) | (header cell 1,2)|... |...
}}

Continuing pages (body):

{{Aligned table
| noheader=yes; nofooter=yes <!--  required if data extends over more than one page.-->
... 
| (data cell x,1) | (data cell x,2)|... |... 
| (data cell x+1,1) | (data cell x+1,2)|... |... 
}}

Continuing pages (footer) as for first page. Last page header as for continuing pages.

Last page body.

{{Aligned table
| noheader=yes; <!--  required if data extends over more than one page. nofooter line is absent -->
... 
| (data cell x,1) | (data cell x,2)|... |... 
| (data cell x+1,1) | (data cell x+1,2)|... |... 
}}
{{nop}}<!-- Optional but needed in some instances to create an appropriate break.-->

Parameters

Parameter Description Examples Default
cols Number of columns in the table. |cols=4 2
fullwidth Şablon:Nowrap
(Effect is to remove border-spacing and add width:100% to the table's styling.)
|fullwidth=on not set
class CSS/HTML class/es applied to the table. |class=wikitable   |class=infobox
|class=sortable nowrap   |class=sidebar
none
style CSS styling applied to the table. Şablon:Nowrap none
colwidth Width of each column (or include "width:...;" in colstyle). |colwidth=6.0em   |colwidth=25% not set (only applied if no relevant colŞablon:Varwidth or colwidthŞablon:Var present)
colstyle CSS styling applied to each column. |colstyle=background:transparent; none
colalign Alignment (left/right/center/justify) applied as "text-align:" prepended to all column stylings. |colalign=justify none set
rowstyle CSS styling applied to each row (includes "aboveŞablon:Var" rows.) |rowstyle=text-align:center; none
title text to be applied as overall table caption. |title=Summary of Data not caption
titlestyle CSS styling applied to table caption. |titlestyle=font-style:italic;font-variant:small-caps; empty
above text to be applied as full span (covers all columns) table header. |above=Precis discussing the following… no spanning header
abovestyle CSS styling applied to spanning header cell. |avovestyle=background:color:grey empty
leftright Set to anything ("on", "true", "yes", etc) in place of |col1align=left and |col2align=right |leftright=on not set
colŞablon:Varwidth Width of column number Şablon:Var (or include "width:...;" in colŞablon:Varstyle). |col2width=9.0em   |col3width=35% none set
colwidthŞablon:Var Width of column number Şablon:Var (or include "width:...;" in colŞablon:Varstyle). |colwidth4=5em   |colwidth5=50% none set
colŞablon:Varclass Class/es applied to column number Şablon:Var. |col1class=navbox-group "
colclassŞablon:Var Class/es applied to column number Şablon:Var. |colclass3=prose "
classŞablon:Var Class/es applied to column number Şablon:Var. |class4=redalert "
colŞablon:Varalign Alignment (left\right\center) for column Şablon:Var's cell contents (or include "text-align:...;" in colŞablon:Varstyle). |col4align=right none set
alignŞablon:Var Alignment (left\right\center) for column Şablon:Var's cell contents (or include "text-align:...;" in colŞablon:Varstyle). |align4=right none set
colŞablon:Varnowrap Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column Şablon:Var's cell styling (i.e. to prevent lines within its cells from wrapping; or include "nowrap" in colŞablon:Varclass or "white-space:nowrap;" in colŞablon:Varstyle). |col5nowrap=on "
colnowrapŞablon:Var Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column Şablon:Var's cell styling (i.e. to prevent lines within its cells from wrapping; or include "nowrap" in colŞablon:Varclass or "white-space:nowrap;" in colŞablon:Varstyle). |colnowrap2=on "
nowrapŞablon:Var Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column Şablon:Var's cell styling (i.e. to prevent lines within its cells from wrapping; or include "nowrap" in colŞablon:Varclass or "white-space:nowrap;" in colŞablon:Varstyle). |nowrap6=on "
colŞablon:Varstyle CSS styling applied to column number Şablon:Var. |col4style=font-style:italic; "
colstyleŞablon:Var CSS styling applied to column number Şablon:Var. |colstyle3=font-weight:bold; "
styleŞablon:Var CSS styling applied to column number Şablon:Var. |colstyle2=background-color:gold; "
colŞablon:Varheader Set to any value (e.g. Y) to change col's cells from data cells to table headers (headings). |col1header=on not set
rowŞablon:Varclass Class/es applied to row number Şablon:Var. |row10class=navbox-abovebelow none set
rowclassŞablon:Var Class/es applied to row number Şablon:Var. |rowclass3=references-small none set
rowŞablon:Varstyle CSS styling applied to row number Şablon:Var. |row2style=font-weight:bold; "
rowstyleŞablon:Var CSS styling applied to row number Şablon:Var. |rowstyle6=color:green; "
rowŞablon:Varheader Set to any value (e.g. Y) to change row's cells from data cells to table headers (headings). |row1header=on not set
aboveŞablon:Var text to be applied as full span (covers all columns) entry above nominated row. |above5=Section II: A New Start empty/no spanning entry
aboveŞablon:Varnormal Unset indicates spanning entry will be inserted as a table header cell with all that implies (centred; bold etc.) If set to anything ("on", "true", "yes", etc) spanning entry will be instead inserted as a standard table cell and only explicitly specified CSS classes or styling will be applied. |above5normal=yes empty
aboveŞablon:Varclass Class/es to be applied to spanning entry above row number Şablon:Var. |above5class=quote empty
aboveŞablon:Varclass CSS styling to be applied to spanning entry above row number Şablon:Var. |above5style=text-align:center empty
classŞablon:Var.Şablon:Var Class/es applied to cell in row Şablon:Var, column Şablon:Var. Overrides any other class attributions (rowŞablon:Varclass, colŞablon:Varclass). |class1.2=adr none set
styleŞablon:Var.Şablon:Var CSS styling applied to cell in row Şablon:Var, column Şablon:Var. Overrides any more general styling (leftright, colŞablon:Varalign, rowŞablon:Varstyle, etc). |style5.3=text-align:right; "
noheader Used to suppress generation of table header in page namespace | noheader=yes <table> is included
nofooter Used to suppress generation of a table footer in page namespace | nofooter=yes </table> is included
nobody Used to suppress generation of a table contents | nobody=yes Only <table></table> is emitted. This can be used when spanning tables over multiple pages. ( see below)
Şablon:Sans-serif 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. | Azerbaijan | Malta | Zaire empty

Examples

{{Aligned table
|cols=3 |class=wikitable
| A | 1 | a
| B | 2 | b
}}
A 1 a
B 2 b
{{Aligned table
|cols=4 |class=wikitable
|col1align=center |col2align=center
|col3align=right  |col4align=right
| AAA | aa    | 123  | 12345
| B   | bbbbb | 1234 | 2
}}
AAA aa 123 12345
B bbbbb 1234 2
{{Aligned table
|class=wikitable |style=width:20em;
|col1align=center |col2align=right
| AAA | 123
| B   | 2
}}
AAA 123
B 2
{{Aligned table
|cols=3 |class=wikitable sortable
|row1header=y
| U | # | l
| A | 1 | a
| B | 2 | b
}}
U # l
A 1 a
B 2 b

Ayrıca bakınız