Having some static HTML content that needs to be formatted using multiple columns, which are presented as pages to the user. The method used is quite simple:
bodyID = document.getElementsByTagName('body')[0];
bodyID.style.width = desiredWidth;
totalHeight = bodyID.offsetHeight;
pageCount = Math.ceil(totalHeight/desiredHeight);
bodyID.style.width = desiredWidth*pageCount;
bodyID.style.height = desiredHeight;
bodyID.style.webkitColumnGap = 0;
bodyID.style.webkitColumnCount = pageCount;
The issue arises when webKit generates more columns than asked for if the content exceeds the specified number of pageCount
.
The challenge is to determine the total number of columns rendered in order to implement pagination accurately. However, retrieving the value of
document.getElementsByTagName('body')[0].style.webkitColumnCount
does not reflect the actual number of columns created.
Any suggestions on how to obtain the correct count of rendered columns?
Appreciate any help provided in advance.