title: iTextSharp table cell colspan
body: <p>I have a table and everything prints out ok, but there's just one problem.
  Even though I set the columns right, it just prints out default widths for each column...</p>
  
  <p>In this case, I tried setting a float[] (when instantiating the table) to see if I could set the widths for each column (even though the colspan of the Cell object should have already taken care of it), but even so it didn't change. Before, I have the integer for the number of columns, but the result was the same. I need some clarification about this, as part of the documentation is outdated.</p>
  
  <pre><code>doc.Add(NewTable(new float[4] { 0, 0, 0, 0 }, new float[3] { 1, 5, 5 }, 250, 0, -1, 200, 150,
                                          new List&lt;Cell&gt;() {
                                              NewCell(new Paragraph("N.º do Auto:").SetFont(FontBold), ColorGray, new SolidBorder(1),1, 1, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE),
                                              NewCell(new Paragraph("fdgdfgdfg").SetFont(FontRegular), ColorGray, new SolidBorder(1),1, 2, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE),
                                              NewCell(new Paragraph("Data:").SetFont(FontBold), ColorGray, Border.NO_BORDER,1, 1, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE),
                                              NewCell(new Paragraph(DateTime.Now.ToString("dd/MM/yyyy")).SetFont(FontRegular), ColorGray, Border.NO_BORDER,1, 2, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE),
                                              NewCell(new Paragraph("Morada:").SetFont(FontBold), ColorGray, Border.NO_BORDER,1, 1, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE),
                                              NewCell(new Paragraph("fdgdfgdfg").SetFont(FontRegular), ColorGray, Border.NO_BORDER,1, 2, 2.5f, HorizontalAlignment.LEFT,VerticalAlignment.MIDDLE)
                                          }));
  
  /// &lt;summary&gt;
          /// Creates a new table
          /// &lt;/summary&gt;
          /// &lt;param name="paddings"&gt;An array of values to set the table's paddings (top, right, bottom, left).&lt;/param&gt;
          /// &lt;param name="pointColumnWidths"&gt;An array of values to specify the number of columns ocupied by each cell in the row.&lt;/param&gt;
          /// &lt;param name="width"&gt;The table's width.&lt;/param&gt;
          /// &lt;param name="rowStart"&gt;The table row from which to start writing.&lt;/param&gt;
          /// &lt;param name="rowEnd"&gt;The table row to which to end writing (-1 for all rows).&lt;/param&gt;
          /// &lt;param name="horizontalPosition"&gt;The table's horizontal position (from the bottom left).&lt;/param&gt;
          /// &lt;param name="verticalPosition"&gt;The table's vertical position (from the bottom left).&lt;/param&gt;
          /// &lt;param name="cells"&gt;A list of cells to be added to the table.&lt;/param&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          private static Table NewTable(float[] paddings, float[] pointColumnWidths, float width, int rowStart, int rowEnd, float horizontalPosition, float verticalPosition, List&lt;Cell&gt; cells)
          {
              Table table = new Table(pointColumnWidths);
  
              table.SetPaddings(paddings[0], paddings[1], paddings[2], paddings[3]);
  
              foreach (Cell cell in cells)
                  table.AddCell(cell);
  
              table.SetFixedPosition(horizontalPosition, verticalPosition, width);
  
              return table;
          }
  
          /// &lt;summary&gt;
          /// Creates a new cell
          /// &lt;/summary&gt;
          /// &lt;param name="paragraph"&gt;A Paragraph object with the content.&lt;/param&gt;
          /// &lt;param name="backgroundColor"&gt;The background color of the cell.&lt;/param&gt;
          /// &lt;param name="border"&gt;The border to be applied to the cell.&lt;/param&gt;
          /// &lt;param name="rowSpan"&gt;The number of rows that the cell will ocupy in the table.&lt;/param&gt;
          /// &lt;param name="colSpan"&gt;The number of columns that the cell will ocupy in the table.&lt;/param&gt;
          /// &lt;param name="padding"&gt;The padding of the cell.&lt;/param&gt;
          /// &lt;param name="horizontalAlignment"&gt;The enum value for the horizontal alignment. Ex: HorizontalAlignment.LEFT&lt;/param&gt;
          /// &lt;param name="verticalAlignment"&gt;The enum value for the vertical alignment. Ex: VerticalAlignment.MIDDLE&lt;/param&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          private static Cell NewCell(Paragraph paragraph, Color backgroundColor, Border border, int rowSpan, int colSpan, float padding, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
          {
              Cell cell = new Cell(rowSpan, colSpan);
              cell.SetBackgroundColor(backgroundColor);
              cell.SetHorizontalAlignment(horizontalAlignment);
              cell.SetVerticalAlignment(verticalAlignment);
              cell.SetPadding(padding);
              cell.SetBorder(border);
              cell.Add(paragraph);
  
              return cell;
          }
  </code></pre>