வார்ப்புரு:Historical populations/doc
{{Documentation subpage}}
 {{lua|Module:Historical populations}}
 &lt;!-- PLEASE ADD CATEGORY LINKS AT THE END OF THIS PAGE --&gt;
 
 '''Template:Historical populations''' is used as an information box on pages, showing each census year with a population, and a percent gain/loss comparison. It is intended to combine the functionalities of two existing templates, [[Template:US Census population]] and [[Template:Histpop]], the former of which is specialized for the United States, and the latter of which lacks many features of the former.
 
 ==Usage==
 This template takes a series of parameters in the form &lt;code&gt;|date |population&lt;/code&gt;. This template does not require any more than that. This template will take between 0 and 50 entries; any more will be ignored.
 
 ===Complete template===
 &lt;pre&gt;
 {{Historical populations
 |title       = 
 |type        = 
 |align       = 
 |direction   =
 |width       = 
 |state       = 
 |shading     = 
 |pop_name    =
 |percentages = 
 |footnote    = 
 |source      = 
 |date |population
 |date |population
 |date |population
 |date |population
 |date |population
 |date |population
 |date |population
 }}
 &lt;/pre&gt;
 
 ===Parameters===
 {|class=&quot;wikitable&quot;
 !Parameter
 !Description
 |-
 |date&lt;sub&gt;''n''&lt;/sub&gt;
 |Ideally, a four-digit year, but can be anything. Usually a multiple of 10, but does not have to be.
 |-
 |population&lt;sub&gt;''n''&lt;/sub&gt;
 |The population of row ''n''. Must be a plain number with no formatting (commas, etc.).
 |-
 |title
 |''Optional.'' The title of the table.
 * &lt;code&gt;Historical population&lt;/code&gt; ('''Default''')
 |-
 |type
 |''Optional.'' This is designed to add functionality specific to different regions or types of information. Currently the only value that does anything is &lt;code&gt;US&lt;/code&gt; (or the obsolescent &lt;code&gt;USA&lt;/code&gt;).
 * &lt;code&gt;none&lt;/code&gt; ('''Default''')
 * &lt;code&gt;US&lt;/code&gt; Will link each year to the relevant [[United States Census]] entry. Years that do not have entries will be left alone.
 
 Please think of more ideas for this feature.
 |-
 |align
 |''Optional.'' The alignment of the table on the page.
 * &lt;code&gt;right&lt;/code&gt; ('''Default''')
 * &lt;code&gt;left&lt;/code&gt;
 * &lt;code&gt;center&lt;/code&gt;
 * &lt;code&gt;none&lt;/code&gt;
 |-
 |direction
 |''Optional.'' How the box is arranged on the page.
 * &lt;code&gt;vertical&lt;/code&gt; ('''Default''')
 * &lt;code&gt;horizontal&lt;/code&gt;
 |-
 |clear
 |''Optional.'' Use to clear any left or right floating elements nearby.
 * &lt;code&gt;right&lt;/code&gt; ('''Default''' if align = right)
 * &lt;code&gt;left&lt;/code&gt; ('''Default''' if align = left)
 * &lt;code&gt;none&lt;/code&gt; ('''Default''' if align = none)
 * &lt;code&gt;both&lt;/code&gt;
 |-
 |width
 |''Optional.'' The width of the table (or of each block of columns). Can be any valid CSS &lt;code&gt;width&lt;/code&gt; value.
 * &lt;code&gt;15em&lt;/code&gt; ('''Default''')
 |-
 |state
 |''Optional.'' The collapsed state of the table. Set it to &lt;code&gt;collapsed&lt;/code&gt; to collapse the table by default.
 * &lt;code&gt;none&lt;/code&gt; ('''Default''')
 * &lt;code&gt;collapsed&lt;/code&gt;
 |-
 |shading
 |''Optional.'' Whether to mark off every five entries with a line, to facilitate reading. This works best with large, linear lists (such as the US Census, which has been taken every 10 years for over 200 years), but should probably be turned off for small or irregular lists (e.g., less than 10 entries), where it could be confusing.
 * &lt;code&gt;on&lt;/code&gt; ('''Default''')
 * &lt;code&gt;off&lt;/code&gt;
 |-
 |pop_name
 |''Optional.'' The text in the column header of the population data.
 * &lt;code&gt;&lt;nowiki&gt;{{abbr|Pop.|Population}}&lt;/nowiki&gt;&lt;/code&gt; ('''Default''', displays as {{abbr|Pop.|Population}})
 |-
 |percentages
 |''Optional.'' Whether to include an automatically generated column of percent differences. This works best with linear lists (1900, 1910, 1920, etc.). Alternately, you can specify &quot;'''pagr'''&quot; to display annual growth rates ('''per annum growth rate''') using the formula from [[Population growth]].
 * &lt;code&gt;on&lt;/code&gt; ('''Default''')
 * &lt;code&gt;pagr&lt;/code&gt;
 * &lt;code&gt;off&lt;/code&gt;
 |-
 |cols
 |''Optional.'' Total number of columns of data (default is &lt;code&gt;1&lt;/code&gt;).  This is useful for very long tables, or when {{para|align|none}}.
 |-
 |source
 |''Optional.'' Displayed as a footnote under the table with the text &quot;Source:&quot; inserted automatically. '''Every table should indicate the source of the data.'''
 |-
 |footnote
 |''Optional.'' Free-form footnote. Can be used as a variant to, or in addition to, the ''source'' parameter.
 |}
 
 ==Examples==
 
 ===United States===
 {{Historical populations
 |type = US
 |source = {{cite web|url=http://factfinder.census.gov|publisher=[[United States Census Bureau]]|title=American FactFinder}}
 |1890 |1046964
 |1900 |1293697
 |1910 |1549008
 |1920 |1823779
 |1930 |1950961
 |1940 |1931334
 |1950 |2071605
 |1960 |2002512
 |1970 |1948609
 |1980 |1688210
 |1990 |1585577
 |2000 |1517550
 |2006 (est.)
       |1448394
 }}
 
 The following code will yield the table on the right.
 
 &lt;pre style=&quot;width: 40em;&quot;&gt;{{Historical populations
 |type = US
 |source = {{subst:Historical populations/USCensusRef}}
 |1890 |1046964
 |1900 |1293697
 |1910 |1549008
 |1920 |1823779
 |1930 |1950961
 |1940 |1931334
 |1950 |2071605
 |1960 |2002512
 |1970 |1948609
 |1980 |1688210
 |1990 |1585577
 |2000 |1517550
 |2006 (est.)
       |1448394
 }}&lt;/pre&gt;
 {{clear}}
 
 ===Smaller areas===
 {{Historical populations
 |width = 10em
 |shading = off
 |percentages = off
 |1845|749
 |1951|6717
 |1960|6984
 |1970|31752
 |1980|34758
 |1990|35888
 |2000|39317
 |footnote = Note: Sandefjord and [[Sandar]] were merged in 1970.
 |source = [http://www.ssb.no SSB]
 }}
 
 The following code will yield the table on the right.
 
 &lt;pre style=&quot;width: 40em;&quot;&gt;{{Historical populations
 |width = 10em
 |shading = off
 |percentages = off
 |1845 |749
 |1951 |6717
 |1960 |6984
 |1970 |31752
 |1980 |34758
 |1990 |35888
 |2000 |39317
 |footnote=Note: Sandefjord and [[Sandar]] were merged in 1970.
 |source = [http://www.ssb.no SSB]
 }}&lt;/pre&gt;
 
 ===Non-regular date ranges===
 {{Historical populations
 | title= Population census
 | percentages = pagr
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}
 
 For non-regular date ranges, use &lt;code&gt;percentages=pagr&lt;/code&gt; to show annual growth rate percentages.
 
 &lt;pre style=&quot;width: 40em;&quot;&gt;{{Historical populations
 | title= Population census
 | percentages = pagr
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}&lt;/pre&gt;
 
 ===Two columns===
 For a multicolumn non-floating table use &lt;code&gt;align=none&lt;/code&gt; and &lt;code&gt;cols=2&lt;/code&gt;
 
 &lt;pre style=&quot;width: 40em;&quot;&gt;{{Historical populations
 | title= Population census
 | percentages = pagr
 | align = none
 | cols = 2
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}&lt;/pre&gt;
 
 {{Historical populations
 | title= Population census
 | percentages = pagr
 | align = none
 | cols = 2
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}
 
 ===Horizontal direction===
 For a horizontally arranged table use &lt;code&gt;direction=horizontal&lt;/code&gt;
 
 &lt;pre style=&quot;width: 40em;&quot;&gt;{{Historical populations
 | title= Population census
 | align = none
 | direction = horizontal
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}&lt;/pre&gt;
 
 {{Historical populations
 | title= Population census
 | align = none
 | direction = horizontal
 | 1903 |219928
 | 1960 |1138611
 | 1970 |1330788
 | 1975 |1479116
 | 1980 |1630485
 | 1990 |1601234
 | 1995 |1654761
 | 2000 |1581082
 | 2007 |1660714
 | 2010 |1652171
 }}
 
 ==See also==
 * [[Template:US Census population]]
 * [[Template:Demography]] — for horizontal tables
 
 
 &lt;includeonly&gt;{{Sandbox other||
 
 &lt;!-- CATEGORY LINKS HERE, THANKS --&gt;
 [[Category:History and events templates]]