Resizing and fitting a group of rectangles so that they do not leave any space in between each other

Duplicate threads are getting to be a bad habit with you, @James_Foley. Please stop that?

Also, how about providing code with your posts without being asked each time? See #3 on this page: