title: printing a pretty table in c in a linux-terminal
body: <p>I have written a small database for students. After getting the data from Terminal,  I want to print this data in a pretty table. This Table looks like:</p>
  
  <pre><code>lastname|firstname|enrollement nr|subject|nationality. 
  </code></pre>
  
  <p>But I am not able to print a whole line of data. It means if I want to print informations about one student, the data will be split into two lines. The header of the table will be not split but each line of the table will be split. Here is the code:</p>
  
  <pre><code> void display_db(){
      printf("lastname|firstname|enrollement nr|subject   |nationality\n");
      printf("========================================================\n");
      int i;
      for(i=0;i&lt;SIZE;i++){
           printf("%10s|%10s|%10d|%10s|%10s\n",           
               (db+i)-&gt;lastname,(db+i)-&gt;firstname,(db+i)-&gt;mNr,   (db+i)-&gt;subject, (db+i)-&gt;nationality);
      }
   }
  </code></pre>
  
  <p>Here a picture:</p>
  
  <p><img src="https://i.stack.imgur.com/UQdZJ.png" alt="enter image description here"></p>
  
  <p>After deleting the special character '\n', I modified the code for printing the table. The table is now pretty. Here is the code:</p>
  
  <pre><code>void display_db(){
  printf("%10s|%10s|%10s|%30s|%10s\n","lastname","firstname","enroll. nr","subject","nationality");
  printf("========================================================\n");
  int i;
  for(i=0;i&lt;SIZE;i++){
  printf("%10s|%10s|%10d|%30s|%10s\n",            
          (db+i)-&gt;lastname,(db+i)-&gt;firstname,(db+i)-&gt;mNr, (db+i)-&gt;subject, (db+i)-&gt;nationality);
  }
  </code></pre>
  
  <p>}</p>