title: Java - How to use the format specifier string "%6d | %5d | %6.2f%n
body: <p>I want to use the format specifier string  "%6d | %5d | %6.2f%n" to format a table in Java, the ways I have tried has given me errors, I would like to use it in the piece of code below using <code>System.out.printf();</code></p>
  
  <pre><code> System.out.printf(" Person |  Mark   |Difference from mean ");
   for (int index4 = 0; index4 &lt; numberOfMarks; index4++) 
       System.out.println((index4 + 1) + "|" +  marksArray[index4] + "|" + 
                         (meanMark - marksArray[index4]));
  </code></pre>
  
  <p>Thanks in advance!</p>