I need a simple algorithm using JQuery or any other JS framework (or vanilla js) that given a JSON array of text, try to fit each item of the array onto a fixed size div, and create a new div to fit the other items.
I basically want to emulate CSS regions but in javascript only.
I have a flipbook component that based on the number of divs creates pages, and so my json array will have guest book entries and some entries are long, some entries are short, so I want to fill a page with entries before creating a new div.