title: The table width must be greater than zero exception when using nested tables
body: <p>I am trying to use nested tables with iText. I get a DocumentException:</p>
  
  <blockquote>
    <p>The table width must be greater than zero. </p>
  </blockquote>
  
  <p>The outer table has 16 columns. I call a method that passes in the outer table. This method adds two inner tables. If I add either one of the inner tables it works fine. If I add the second inner table I get the exception which is thrown form the PdfPTable.writeSelectedRows method.</p>
  
  <pre><code>private final float[] columnWidths = {183, 31, 88, 49, 35, 25, 35, 35, 35, 32, 32, 33, 35, 60, 46, 26 };      
  
  public void buildPdfReport(ByteArrayOutputStream out) {
       Document document;
       PdfWriter pdfWriter;   
  
       document= new Document(PageSize.LETTER.rotate(), 2, 2, 5, 2);
       pdfWriter = PdfWriter.getInstance(document, out);
       document.open();
  
       PdfPTable outerTable = new PdfPTable(columnWidths);
       table.setTotalWidth(770F);
       table.setLockedWidth(true);
       buildNestedTables(table);
  
       document.add(outerTable);
       document.newPage();
       document.close();
       pdfWriter.close();
  
  }
  
  private void buildNestedTables(PdfPTable outerTable) {
       PdfPTable innerTable1 = new PdfPTable(1);
       PdfPTable innerTable2 = new PdfPtable(2);
       PdfPCell cell;
  
       innerTable1.addCell("Cell 1");
       innerTable1.addCell("Cell 2");
       outerTable.addCell(innerTable1);
  
       innerTable2.addCell("Cell 3");
       innerTable2.addCell("Cell 4");
       outerTable.addCell(innerTable2);
  
       cell = new PdfPCell("");
       cell.setColspan(14);
       outerTable.addCell(cell);
  }
  </code></pre>
  
  <p>I'm not sure what I am missing.</p>
  
  <p>Thank you for any help,</p>
  
  <p>Greg</p>