Skip to main content
2 of 2
added 344 characters in body
george2079
  • 39.1k
  • 1
  • 44
  • 111

Supposing you want to print from inside the loop (not waiting for the loop to finish) you can use Grid on each line with specified field widths:

 Do[
      Print@Grid[{{
        RandomChoice[DictionaryLookup["*"]], "=", 
        RandomReal[{1, 10}]^RandomInteger[12]}},
          ItemSize -> {{10, Full, 8}},
          Alignment -> {{Right, Center, Right}}],
    {10}]

enter image description here

Another approach for nicely formatted monitoring..

out = {};
Monitor[
     Do[  Pause[1]; 
          AppendTo[out, {RandomChoice[DictionaryLookup["*"]], "=", 
                         RandomReal[{1, 10}]^RandomInteger[12]}],
       {10}], 
                Grid[out, Alignment -> {Right, Center, Right}]]
george2079
  • 39.1k
  • 1
  • 44
  • 111