If you have a device that supports nth-child selectors you can make this reeeally easily...
If you don't, then you can use your technique, but make sure you have the proper quotation marks around the src="pieces/b.jpg" alt="" (you don't need alt=cp).
You can get rid of any styling in the table itself. Simply give it a class and then put the proper (to your taste) styling in the linked stylesheet. See example for possible css.
Cheers,
edit: I think your extra lines came from the spaces (line breaks) you had between the <img> tags.