Template:Stack documentation/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 Lipsum 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:

Lipsum
... text ...

Lorem
... text ...

Ipsum
... text ... The result of this is shown in the 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:

Lipsum
... text ...

Lorem
... text ...

Ipsum
... text ... The result of this is show in the 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).

Ipsum




Ipsum




Ipsum




Ipsum




Ipsum




Ipsum




Note
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 stack mid, at least in one example, was resolved by removing table style  from tables between stack begin and stack end.

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 {| ... |} table syntax (which must begin on the start of the line).

More examples
can also be used to float one or more images across a page.



It might take some experience to learn how the box area floats, in combination with various images or wikitables on a page. 's operation is very quick, as it uses an HTML &lt;table> to achieve its effects.

Floating portal boxes
can be used to float a portal box beside an infobox (or other right-aligned item) when other methods might not work as anticipated.

The example here uses to float two portal boxes (Animals, Cats) as follows:

The two portal-boxes are stacked and floated together by both being listed as 's (first) parameter. Because the infobox and image were also stacked together, moved the two portal-boxes alongside the infobox despite their being specified after the image.

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.