title: How to fill a PdfPTable column by column instead of row by row, using iText
body: <p>I am using Java with iText in order to generate some PDFs. I need to put text in columns, so I am trying to use PdfPTable. I create it with:</p>
  
  <pre class="lang-java prettyprint-override"><code>myTable = new PdfPTable(n);
  </code></pre>
  
  <p><code>n</code> being the number of columns. The problem is that PdfPTable fills the table row by row, that is, you first give the cell in column 1 of row 1, then column 2 of row 1, and so on, but I need to do it column by column, because that is how the data is being fed to me.</p>
  
  <p>I would use a <code>Table</code> (which lets you specify the position) like in <a href="http://stderr.org/doc/libitext-java-doc/www/tutorial/ch05.html" rel="noreferrer">http://stderr.org/doc/libitext-java-doc/www/tutorial/ch05.html</a>, but I get a "could not resolve to a type", and my Eclipse can't find the proper import.</p>
  
  <p><em>Edit</em>: in case my previous explanation was confusing, what I want is to fill the table in this order:</p>
  
  <pre><code>1  3  5
  2  4  6
  </code></pre>
  
  <p>Instead of this:</p>
  
  <pre><code>1  2  3
  4  5  6
  </code></pre>