வார்ப்புரு:Stack documentation
&lt;noinclude&gt;
 {{ombox|text=This template serves as the shared documentation for {{tl|Stack}}, {{tl|Stack begin}}, {{tl|Stack mid}}, and {{tl|Stack end}}.}}
 &lt;/noinclude&gt;
 This template can be used to stack images and other floating content such as infobox templates without causing problems with spacing and floating. Enter a string of images/templates as the first parameter to have them stack without generating floating errors or spacing errors. You can stack many objects from the top of a section and not force further subsections to space out.
 
 === Basic usage ===
 
 Using {{tld|stack}},
 
 &lt;pre style=&quot;overflow: auto&quot;&gt;
 {{stack|&lt;objects&gt;}}
 &lt;/pre&gt;
 
 or, alternatively, using {{tld|stack begin}}/{{tld|stack end}}
 
 &lt;pre style=&quot;overflow: auto&quot;&gt;
 {{stack begin}}
 &lt;object&gt;
 {{stack mid}}
 &lt;object&gt;
 ...
 {{stack end}}
 &lt;/pre&gt;
 
 Previous usage suggests &lt;nowiki&gt;{{stack mid}}&lt;/nowiki&gt; is not always needed. Thus, &lt;code&gt;&lt;object&gt;&lt;/code&gt; may simply a string of wiki code for many images / templates.
 
 ==== Optional parameters ====
 :&lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;stack| &lt;objects&gt; | float=left/'''right''' | clear=true/'''false'''&lt;nowiki&gt;}}&lt;/nowiki&gt;&lt;/code&gt;
 or
 :&lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;stack begin | float=left/'''right''' | clear=true/'''false'''&lt;nowiki&gt;}}&lt;/nowiki&gt;&lt;/code&gt;
 where
 :*&lt;code&gt;float=&lt;/code&gt; ''left'' or ''right'' (default is '''right''')
 :*: This option can be used to float the stack to the left or right of the page
 :*&lt;code&gt;clear=&lt;/code&gt; ''true'' or ''false'' (default is '''false''')
 :*: This option can be used to force the stack to the far left or right (e.g., near an infobox).
 
 You can also explicily list multiple arguments, which is then identical to the {{tl|stack begin}}, {{tl|stack mid}} and {{tl|stack end}} version.
 :&lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;stack| float=left/'''right''' | clear=true/'''false'''
 :|1=&lt;object(s)&gt;
 :|2=&lt;object(s)&gt;
 :|3=&lt;object(s)&gt;, etc. up to 9 parameters in the current version
 :&lt;nowiki&gt;}}&lt;/nowiki&gt;&lt;/code&gt;
 
 *NB This multiple argument version does include extra vertical whitespace between each (set of) &amp;lt;object(s)&gt;.
 
 ===Basic examples===
 To illustrate the utility of the stack templates, consider the following situation.  We would like to have two right floating images at the top of the first section of our article (here, the &quot;Lipsum&quot; section), and one left floating image at the top of the second section (here, the Lorem section).  To achieve this layout, without using a stack template, we could try the following code
 &lt;pre&gt;
 =====Lipsum=====
 [[File:Example.png|thumb|right|Example 1a]]
 [[File:Example.png|thumb|right|Example 1b]]
 ... text ...
 
 =====Lorem=====
 [[File:Example.png|thumb|left |Example 1c]]
 ... text ...
 
 =====Ipsum=====
 ... text ...
 &lt;/pre&gt;
 The result of this is shown in the [[#Without stack|without stack]] section below.  Notice how the left floating image (Example 1c) is prevented from floating above the last right floating image (Example 1b).  You may need to resize the width of your browser to fully appreciate the issue.  To fix this problem, we can stack the two right floating images together, using the following code
 &lt;pre&gt;
 =====Lipsum=====
 {{stack|
 [[File:Example.png|thumb|right|Example 2a]]
 [[File:Example.png|thumb|right|Example 2b]]
 }}
 ... text ...
 
 =====Lorem=====
 [[File:Example.png|thumb|left |Example 2c]]
 ... text ...
 
 =====Ipsum=====
 ... text ...
 &lt;/pre&gt;
 The result of this is show in the [[#With stack|with stack]] section below.  Notice how by adding this stack template, the left floating image (Example 2c) can now float higher and is not blocked from floating higher than the top of the last right floating image (Example 2b).
 
 {{-}}
 ====Without stack ====
 =====Lipsum=====
 [[File:Example.png|thumb|right|Example 1b]]
 [[File:Example.png|thumb|right|Example 2b]]
 
 {{lipsum}}
 
 =====Lorem=====
 [[File:Example.png|thumb|left |Example 3b]]
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 ====With stack ====
 =====Lipsum=====
 {{stack|
 [[File:Example.png|thumb|right|Example 1a]]
 [[File:Example.png|thumb|right|Example 2a]]
 }}
 {{lipsum}}
 
 =====Lorem=====
 [[File:Example.png|thumb|left |Example 3a]]
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 ====With stack begin====
 =====Lipsum with second table wider=====
 {{stack begin}}
 {|class=wikitable
 !Sample table 1
 |-
 |Example 1a
 |-
 |Example 1b
 |}
 {|class=wikitable
 !Sample wider table 2
 |-
 |Example 2a
 |-
 |Example 2b
 |}
 {{stack end}}
 {{lipsum}}
 
 =====Lorem=====
 {|
 !Sample table 3
 |-
 |Example 3a
 |}
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 =====Lipsum with first table wider=====
 {{stack begin}}
 {|class=wikitable
 !Sample wider table 1
 |-
 |Example 1a
 |-
 |Example 1b
 |}
 {|class=wikitable
 !Sample table 2
 |-
 |Example 2a
 |-
 |Example 2b
 |}
 {{stack end}}
 {{lipsum}}
 
 =====Lorem=====
 {|
 !Sample table 3
 |-
 |Example 3a
 |}
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 
 ====With stack begin and mid====
 =====Lipsum with second table wider=====
 {{stack begin}}
 {|class=wikitable
 !Sample table 1
 |-
 |Example 1a
 |-
 |Example 1b
 |}
 {{stack mid}}
 {|class=wikitable
 !Sample wider table 2
 |-
 |Example 2a
 |-
 |Example 2b
 |}
 {{stack end}}
 {{lipsum}}
 
 =====Lorem=====
 {|
 !Sample table 3
 |-
 |Example 3a
 |}
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 =====Lipsum with first table wider=====
 {{stack begin}}
 {|class=wikitable
 !Sample wider table 1
 |-
 |Example 1a
 |-
 |Example 1b
 |}
 {{stack mid}}
 {|class=wikitable
 !Sample table 2
 |-
 |Example 2a
 |-
 |Example 2b
 |}
 {{stack end}}
 {{lipsum}}
 
 =====Lorem=====
 {|
 !Sample table 3
 |-
 |Example 3a
 |}
 {{lipsum}}
 
 =====Ipsum=====
 
 {{lipsum}}
 
 {{lipsum}}
 
 {{-}}
 ====''NB''====
 ''Obviously these current examples '''don't''' show any difference between with and without mid'' except for probably ''unwanted'' vertical space.
 
 In fact, the reason for creating {{tl|stack mid}}, at least in [http://en.wikipedia.org/w/index.php?title=Colorado_River&amp;diff=483291966&amp;oldid=483039105 one example], was resolved by removing [[Help:Table#Tables|table style]] &lt;code&gt;align=right&lt;/code&gt; from tables between {{tl|stack begin}} and {{tl|stack end}}.
 
 However {{tl|stack mid}} may still be useful for tables that would otherwise prefer to use the multiple argument {{tl3|stack|one|two|three...}} option, which should be identical to using {{tl|stack begin}}, {{tl|stack mid}} and {{tl|stack end}} where the latter easily allows the &lt;nowiki&gt;{| ... |}&lt;/nowiki&gt; [[Help:Table|table syntax]] (which must begin on the start of the line).
 
 ===More examples===
 Stack can also be used to float 1 or more images across a page.
 {{stack|[[File:Example.png|50px]]}}
 {{stack|[[File:Example.png|50px]]}}
 &lt;pre style=&quot;width: 25em; overflow: auto&quot;&gt;
 {{stack|[[File:Example.png|50px]]}}
 {{stack|[[File:Example.png|50px]]}}
 &lt;/pre&gt;
 It might take some experience to learn how the box area floats, in combination with various images or [[WP:Wikitables]] on a page. The operation of Template:stack is very quick, using the &amp;lt;table&gt; feature of the [[HTML]] [[markup language]].
 
 ===Float portal boxes===
 Because auto-floating of portal boxes could cause a loss of margin control, the [[Template:stack]] can be used, as needed in some articles, when floating a portal box would look better alongside an infobox (or right-side image).
 {| class=infobox
 | '''Infobox'''
 &lt;br&gt;Line 1&lt;br&gt;Line 2&lt;br&gt;Line 3&lt;br&gt;Line 4&lt;br&gt;L5&lt;br&gt;L6&lt;br&gt;L7&lt;br&gt;L8 &lt;br&gt;L9
 |}
 [[File:Mona Lisa, by Leonardo da Vinci, from C2RMF retouched.jpg|thumb|right|60px|Test]]
 {| class=wikitable
 | width=420px|
 A '''wikitable''' here, as a typical left-side table. The overlap on left-side tables had been a frequent problem with allowing other boxes to &quot;float:right&quot; on a page. So this is a test of how well a floating portal-box would avoid overlapping onto a left-side table.
 |}
 {{stack|{{portal|Animals}}{{portal|Cats}} }}
 The example here uses {{tld|stack}} to float 2 portal boxes (for Animals &amp; Cats), as follows:
 :* &lt;nowiki&gt;{{stack |{{portal|Animals}}{{portal|Cats}} }}
 &lt;/nowiki&gt;
 The 2 portal-boxes are stacked together, and floated together as a stack, by both being listed in parameter 1 to {{tld|stack}}. Although the 2 portal-boxes were specified ''below'' the [[Mona Lisa]] image, because the infobox+image were also stacked together, then the {{tld|stack}} moved the 2 portal-boxes, even higher, alongside the infobox.
 
 Normally, a portal-box would be stuck below the Mona Lisa image, causing this entire text section to format further below, and causing a large text-gap of empty whitespace to appear near the infobox. There is no limit to the number of portalboxes (or Commonscat boxes) which can be listed within a {{tld|stack}} call, such as in a stub or an article with many stacked images near the bottom. Using {{tld|stack}} is extremely efficient, due to being a short template which uses builtin tag &amp;lt;table&gt; to float the boxes.
 
 === Stack templates ===
 * {{tl|Stack}}
 * {{tl|Stack begin}}
 * {{tl|Stack mid}}
 * {{tl|Stack end}}
 
 === See also ===
 * {{tl|Double image}} places images side by side horizontally
 * {{tl|Multiple image}} allows both vertical and horizontal layouts
 * {{tl|Superimpose}}—places one image over another
 * {{tl|Superimpose2}}—places up to 50 image layers over one another
 
 &lt;includeonly&gt;
 &lt;!-- Shared categories go here: --&gt;
 
 &lt;/includeonly&gt;&lt;noinclude&gt;
 [[Category:Template documentation]]