title: How to draw a nice ASCII table in C?
body: <p>I want to draw a table like,</p>
  
  <pre><code>----------
  |   |    |
  ----------
  |   |    |
  ----------
  |   |    |
  ----------
  |   |    |
  ----------
  </code></pre>
  
  <p>however, it looked messy and ugly :(. Another thing bothered me is the width of each row, since inside each box, contains a number. </p>
  
  <pre><code>void draw_table( entry* ptr, int size ) {
      int x = 0;
      for( ; x &lt; size; ++x ) {
          printf( "_____ _____ \n" );
          printf( "| %d | %d | \n", ptr[x].virtual_page, ptr[x].page_frame );
      }
  }
  </code></pre>
  
  <p>How could I match the length of the each <code>"_____"</code> with the integer (number of digits) inside each box?</p>