From: Douglas F Shearer Date: 2007-08-22T21:07:14+09:00 Subject: Re: Pretty Printing Hi Peter. On 22 Aug 2007, at 12:21, Peter Versteegen wrote: > # But this approach doesn't. Why not? Are there other ways to make > this simpler? Maybe I've got the wrong end of the stick on this, but I get it to work like this: ========================== a = ["a-value","b-value", "c-value"] b = [10,30,15] def header(names, widths) header = '' names.each_with_index do |v,i| header += v.rjust widths[i] end header end p header(a, b) ========================== Hope this helps. Douglas F Shearer dougal.s@gmail.com http://douglasfshearer.com