I have a gallery of images, each of which have the same width and height, say 10px. I want them spaced so that there are 5 on a row and they are each 5px apart, on all sides. The container div has 5px padding. There are multiple rows!
My problem is that if I give each image a left margin of 5px then either:
a) The container div is sized to fit and so only 4 images fit on a row as the fifths margin shunts it onto the next line.
b) The container div is sized with an extra 5px resulting in the an extra gap at the end of each row.
How should I style my images so they all fit on the correct row and without any ugly gaps without changing the containers padding?