title: Centering strings with printf()
body: <p>By default, <code>printf()</code> seems to align strings to the right.</p>
  
  <pre><code>printf("%10s %20s %20s\n", "col1", "col2", "col3");
  /*       col1                 col2                 col3 */
  </code></pre>
  
  <p>I can also align text to the left like this:</p>
  
  <pre><code>printf("%-10s %-20s %-20s", "col1", "col2", "col3");
  </code></pre>
  
  <p>Is there a quick way to center text? Or do I have to write a function that turns a string like <code>test</code> into <code>(space)(space)test(space)(space)</code> if the text width for that column is 8?</p>