Load xml in to mc lining mc up in a row

I can’t figure out how to do this. i have a mc that has 3 text fields category, name, amount and they are being loaded by xml. but when the movie is loaded it loads the mcs inline but i only want them to show 5 in each line. but when its a different category to go to the next line. so for ex.

1 1 1 1 1 - ROW 1

2 2 2 - ROW 2

3 3 3 3 - ROW 3

4 4 - ROW 4

5 5 5 - ROW 5

the numbers = a category so there are 5 (if there happens to be a total of 5) in each row but when the category changes it goes to a different row. anyone help me out? thanks…