Today I want to share about jGridder : https://github.com/eloone/jgridder.
It solves this problem :
Given a height and width and a number of items, how do I place those items as squares in a grid that fits those dimensions?
To see what I mean, peek at the demo : http://eloone.net/jgridder/demo/.
In this post I will share my approach to design the script and tackle the problem, it’s not a tutorial about the code itself. But hopefully it will enlighten and help you regarding similar problems you might have in UI. The focus will be on the method.