title: Figuring out how to Format Printing
body: <p>I'm having trouble figuring out how to format my printing from arraylist,
  I just don't know how to do it. Any tips or snippets that could help? Thank you</p>
  
  <pre><code>protected void printTable(ArrayList&lt;double[]&gt; table)
  {
      String s = "";
      System.out.printf("\n_____________________________________________________\n");
      System.out.printf("\n  x\t   f[]\t    f[,]    f[,,]    f[,,,]   ");
      System.out.printf("\n_____________________________________________________\n");
      for(int a = 0; a &lt; table.size(); a++)
      {
          System.out.printf("%.3s", s);
          for(double c : table.get(a))
          {
              System.out.printf("%.3f\t " , c);
          }
          System.out.println();
      }
  }
  </code></pre>
  
  <p>its printing like this at the moment:</p>
  
  <pre><code>    _____________________________________________________
      x      f[]      f[,]    f[,,]    f[,,,]   
      _____________________________________________________
      1.000    1.500   0.000   2.000   
      3.000    3.250   3.000   1.670   
      0.500    0.167   -0.665  
      0.333    -1.663  
      -1.997   
  </code></pre>
  
  <p>how do I get it to do?</p>
  
  <pre><code>_____________________________________________________
  
  x      f[]      f[,]    f[,,]    f[,,,]   
  _____________________________________________________
  1.000    3.000   0.500   0.333   -1.997
  1.500    3.250   0.167   -1.663  
  0.000    3.000   -0.665  
  2.000    1.670   
  </code></pre>