Balance Text Demo Page

The left and right columns in the table below have identical content and markup, except that the solution is applied to the right side, so compare the rendering between the two sides.

To test how the algorithm works in different text wrapping cases, open this page in any modern browser, and then do either of the following to see how text rendering differs between the two sides:

Note that due to how different browsers send out resize events, you may need to refresh the browser to see the balanced text solution on the right.

Default text

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Captions are a common usage case. Note that width of caption is constrained to width of image.
Blockquotes are another type of text formatting that may benefit from text balancing.
Example of a form label:

Balanced text

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Captions are a common usage case. Note that width of caption is constrained to width of image.
Blockquotes are another type of text formatting that may benefit from text balancing.
Example of a form label: