87051: Centralize and clean-up table column iteration

This test passes if you see 3 rectangles below: green - purple - green (in this order, left to right).