I have a lot of elements like p, span, h1, h2. I don't know how much because it is dynamic. I need to separate elements into a div with 1000px height. So, I need to create multiple pages from one array, based on height.
for (let i = 0; i < items.length; i++) {
$('.page').append(items[i]);
}
Elements example: items = [<ul class="ul1">..</ul>, <p class="p2">..</p>, <p class="p2">..</p>, <table>...</table>, <p class="p2">..</p>,<p class="p2">..</p>,<p class="p2">..</p>]
items have all HTML elements and it is dynamical, can have 10 or 100 elements. The idea is to return page1, page2, page3... etc, with 1000px and the elements. For now, I have one page with all the content.