public bool SetWidths(float[] widths)
{
if (widths.Length != cells.Length)
return false;
System.Array.Copy(widths, 0, this.widths, 0, cells.Length);
float total = 0;
calculated = false;
for (int k = 0; k < widths.Length; ++k) {
PdfPCell cell = cells[k];
if (cell == null) {
total += widths[k];
continue;
}
cell.Left = total;
int last = k + cell.Colspan;
for (; k < last; ++k)
total += widths[k];
--k;
cell.Right = total;
cell.Top = 0;
}
return true;
}