Template:Colwidths/doc: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
Created page with ''''Template:Colwidths''' is to allow you to set the width of columns in each of a set of tables on a page, so that the tables remain in alignment notwithstanding that they are in…'
 
RB (talk | contribs)
No edit summary
 
Line 6: Line 6:
These are not sophisticated templates nor complicated to use:
These are not sophisticated templates nor complicated to use:


===Basic use: percentage widths===
'''1.'''  At the top of the page add {{tl|Colwidths}} with the widths you want as percentages.  It will take up to 8 columns, so:
'''1.'''  At the top of the page add {{tl|Colwidths}} with the widths you want as percentages.  It will take up to 8 columns, so:


Line 23: Line 24:


A table without {{tl|cw}} in it does not form part of the scheme and its columns must be defined individually.
A table without {{tl|cw}} in it does not form part of the scheme and its columns must be defined individually.
===Fixed widths===
The templates assume that percentages are to be used, so "30" is read as "30%".  If however you wish to use fixed widths (as for example ''[[Town and village flags of the United Kingdom|here]]''), then in {{tl|Colwidths}} add an "f" (for "fixed") after the number:
<nowiki>{{</nowiki>Colwidths|110f|50|250f<nowiki>}}</nowiki>
A mixture of fixed widths and percentages is possible: in the above example the "50" has no "f" suffixed and so it is taken as "50%".
The {{tl|Cw}} template is used in exactly the same way in this example.
<includeonly>[[Category:Table templates|Colwidths]]
<includeonly>[[Category:Table templates|Colwidths]]

Latest revision as of 23:24, 30 July 2013

Template:Colwidths is to allow you to set the width of columns in each of a set of tables on a page, so that the tables remain in alignment notwithstanding that they are independent tables and the contents differ.

Template:cw actually defines the column widths, but it is fed its values by {{Colwidths}}


These are not sophisticated templates nor complicated to use:

Basic use: percentage widths

1.  At the top of the page add {{Colwidths}} with the widths you want as percentages. It will take up to 8 columns, so:

{{Colwidths|30|50|20}}

is to define three columns as 30%, 50% and 20% respectively.

2.  In each table to which these values are to apply, use {{cw}}: Begin column 1 with:

{{cw|1}}|

Begin column 2 with:

{{cw|2}}|


and so forth.

A table without {{cw}} in it does not form part of the scheme and its columns must be defined individually.

Fixed widths

The templates assume that percentages are to be used, so "30" is read as "30%". If however you wish to use fixed widths (as for example here), then in {{Colwidths}} add an "f" (for "fixed") after the number:

{{Colwidths|110f|50|250f}}

A mixture of fixed widths and percentages is possible: in the above example the "50" has no "f" suffixed and so it is taken as "50%".

The {{Cw}} template is used in exactly the same way in this example.