# Tiling / Scaling Thumbs to fit

**URL:** <https://forum.kirupa.com/t/tiling-scaling-thumbs-to-fit/225213>\
**Category:** flash\
**Created:** [May 9, 2007, 6:53pm UTC](https://forum.kirupa.com/t/tiling-scaling-thumbs-to-fit/225213 "2007-05-09T18:53:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardeo](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@ardeo](https://forum.kirupa.com/u/ardeo)\
**Post date:** [May 9, 2007, 6:53pm UTC](https://forum.kirupa.com/t/tiling-scaling-thumbs-to-fit/225213/1 "2007-05-09T18:53:25Z")

</div>

Hi… I think that this is tricky, unless I’m missing something. I want to create a gallery that automatically scales the thumbnails that are loaded so that they are as big as can be and fit into rows / columns to fill the screen space. So if I have 20 thumbnails, they will tile nicely, and if I then load 40, they will automatically fill the same space by shrinking… if I load just a few, they will be large, etc…

I’m pretty stuck, though, on figuring out the math – how do I calculate how many columns / rows to setup and then how do i figure out the size of the thumbs?

thanks,  
roland
