Seeking a way to dynamically generate centered rows of three images based on the quantity being loaded. The goal is to have one row for three images, two rows for four images, and four rows for ten images. Both the images and their container div are fixed in size.
My initial strategy involved using float: left, which helped create rows of three images. However, when the browser was resized, some images moved to the next row, causing them not to be centered as required.
If anyone has solutions involving javascript and css to achieve this layout, it would be greatly appreciated. Thank you!