# வார்ப்புரு:Stack documentation

<noinclude>  

</noinclude>  
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 ,  

<pre>  

</pre>  

or, alternatively, using /  

<pre>  

<object>  

<object>  
...  

</pre>  

Previous usage suggests is not always needed. Thus, <code><object></code> may simply a string of wiki code for many images / templates.  

#### Optional parameters
:<code>stack| <objects> | float=/**** | clear=true/**false**</code>  
or  
:<code>stack begin | float=/**** | clear=true/**false**</code>  
where  
:*<code>float=</code> **' or **' (default is ****)  
:*: This option can be used to float the stack to the or of the page  
:*<code>clear=</code> *true* or *false* (default is **false**)  
:*: This option can be used to force the stack to the far or (e.g., near an infobox).  

You can also explicily list multiple arguments, which is then identical to the , and version.  
:<code>stack| float=/**** | clear=true/**false**  
:|1=<object(s)>  
:|2=<object(s)>  
:|3=<object(s)>, etc. up to 9 parameters in the current version  
:</code>  

- NB This multiple argument version does include extra vertical whitespace between each (set of) &lt;object(s)>.

### Basic examples
To illustrate the utility of the stack templates, consider the following situation. We would like to have two floating images at the top of the first section of our article (here, the "Lipsum" section), and one 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  
<pre>  
##### Lipsum

... text ...  

##### Lorem

... text ...  

##### Ipsum
... text ...  
</pre>  
The result of this is shown in the without stack section below. Notice how the floating image (Example 1c) is prevented from floating above the last 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 floating images together, using the following code  
<pre>  
##### Lipsum

... text ...  

##### Lorem

... text ...  

##### Ipsum
... text ...  
</pre>  
The result of this is show in the with stack section below. Notice how by adding this stack template, the floating image (Example 2c) can now float higher and is not blocked from floating higher than the top of the last floating image (Example 2b).  

#### Without stack
##### Lipsum

##### Lorem

##### Ipsum

#### With stack
##### Lipsum

##### Lorem

##### Ipsum

#### With stack begin
##### Lipsum with second table wider

**Example 1a**

| Example 1b | } |
| --- | --- |
**Example 2a**

| Example 2b | } |
| --- | --- |

##### Lorem
| Example 3a | } |
| --- | --- |

##### Ipsum

##### Lipsum with first table wider

**Example 1a**

| Example 1b | } |
| --- | --- |
**Example 2a**

| Example 2b | } |
| --- | --- |

##### Lorem
| Example 3a | } |
| --- | --- |

##### Ipsum

#### With stack begin and mid
##### Lipsum with second table wider

**Example 1a**

| Example 1b | } |
| --- | --- |

**Example 2a**

| Example 2b | } |
| --- | --- |

##### Lorem
| Example 3a | } |
| --- | --- |

##### Ipsum

##### Lipsum with first table wider

**Example 1a**

| Example 1b | } |
| --- | --- |

**Example 2a**

| Example 2b | } |
| --- | --- |

##### Lorem
| Example 3a | } |
| --- | --- |

##### Ipsum

#### *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 , at least in one example, was resolved by removing <code>align=</code> from tables between and .  

However may still be useful for tables that would otherwise prefer to use the multiple argument option, which should be identical to using , and where the latter easily allows the (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.  

<pre>  

</pre>  
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 &lt;table> 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 -side image).  


The example here uses to float 2 portal boxes (for Animals & Cats), as follows:  
:*  
The 2 portal-boxes are stacked together, and floated together as a stack, by both being listed in parameter 1 to . Although the 2 portal-boxes were specified *below* the Mona Lisa image, because the infobox+image were also stacked together, then the 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 call, such as in a stub or an article with many stacked images near the bottom. Using is extremely efficient, due to being a short template which uses builtin tag &lt;table> to float the boxes.  

### Stack templates
- 
- 
- 
- 

=