separate reading and writing of cell widths to prevent layout thrashing

Reading and writing the widths of the cells in one loop will cause [poor performance](http://kellegous.com/j/2013/01/26/layout-performance/) on large tables with many columns.