Plantilla:Aligned table
| Aquesta plantilla utilitza una crida a un mòdul de tipus Lua, nom que li ve del llenguatge Lua que utilitza. Per tant, si volguéssiu modificar-la, abans hauríeu d'estar familiaritzats amb aquest llenguatge i les funcions de l'extensió Scribunto. Vegeu com fer proves de plantilles.
Aquesta plantilla utilitza el següent mòdul: |
El propòsit és d'aquesta plantilla és la generació de taules senzilles en llocs en els quals no és possible posar una taula estàndard, sense un ús significatiu de la paraula màgica {{!}} (per exemple, amb una plantilla {{Barra lateral}}), o per molèstia (haver d'especificar repetitivament una mateixa declaració d'estil en cada fila). Aquesta plantilla no s'ha d'utilitzar per substituir la taula estàndard en els articles. Aquesta plantilla està destinat a ser complementària en una {{Infotaula}} o en una {{Barra lateral}} barra lateral, i no per a substituir-les.
Un mètode més senzill per incloure una taula en una plantilla que no admet directament una taula estàndard és crear la taula en una subplantilla usant marcatge estàndard i transcloure-la.
Sintaxi completa
[modifica]Per a una explicació dels paràmetres, vegeu la taula següent.
{{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) | ... | ...
}}
Paràmetres
[modifica]| Paràmetre | Descripció | Exemples | Predeterminat |
|---|---|---|---|
| cols | Number of columns in the table. | |cols=4
| 2 |
| fullwidth | Set to anything ("on", "true", "yes", etc) to ensure table spans entire width available. (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
| none |
| style | CSS styling applied to the table. | |style=width:80%;background:transparent;
| none |
| colwidth | Width of each column (or include "width:...;" in colstyle). | |colwidth=6.0em |colwidth=25%
| not set |
| colstyle | CSS styling applied to each column. | |colstyle=background:transparent;
| " |
| rowstyle | CSS styling applied to each row. | |rowstyle=text-align:center;
| " |
| leftright | Set to anything ("on", "true", "yes", etc) in place of |col1align=left and |col2align=right | |leftright=on
| not set |
| colCwidth | Width of column number C (or include "width:...;" in colCstyle). | |col2width=9.0em |col3width=35%
| none set |
| colCclass | Class/es applied to column number C. | |col1class=navbox-group
| " |
| colCalign | Alignment (left / right / center) for column C's cell contents (or include "text-align:...;" in colCstyle). | |col4align=right
| none set |
| colCnowrap | Set to anything ("on", "true", "yes", etc) to add "white-space:nowrap;" to column C's cell styling (i.e. to prevent lines within its cells from wrapping; or include "nowrap" in colCclass or "white-space:nowrap;" in colCstyle). | |col5nowrap=on
| " |
| colCstyle | CSS styling applied to column number C. | |col4style=font-style:italic;
| "
|
| colCheader | Set to any value (e.g. Y) to change col's cells from data cells to table headers (headings).
| |col1header=on
| not set |
| rowRclass | Class/es applied to row number R. | |row10class=navbox-abovebelow
| none set |
| rowRstyle | CSS styling applied to row number R. | |row2style=font-weight:bold;
| " |
| rowRheader | Set to any value (e.g. Y) to change row's cells from data cells to table headers (headings).
| |row1header=on
| not set |
| classR.C | Class/es applied to cell in row R, column C. Overrides any other class attributions (rowRclass, colCclass). | |class1.2=adr
| none set |
| styleR.C | CSS styling applied to cell in row R, column C. Overrides any more general styling (leftright, colCalign, rowRstyle, etc). | |style5.3=text-align:right;
| " |
| 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. | | Azerbaijan | Malta | Zaire
| empty |
Exemples
[modifica]{{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 |
Els editors poden fer proves amb aquesta plantilla al seu espai de proves (crea | modifica)
Afegiu categories en la subpàgina /ús. Vegeu les subpàgines d'aquesta plantilla, utilització de paràmetres.