public void AddColumns(int aColumns) {
ArrayList newRows = new ArrayList(rows.Count);
int newColumns = columns + aColumns;
Row row;
for (int i = 0; i < rows.Count; i++) {
row = new Row(newColumns);
for (int j = 0; j < columns; j++) {
row.SetElement(((Row) rows[i]).GetCell(j) ,j);
}
for (int j = columns; j < newColumns && i < curPosition.X; j++) {
row.SetElement(null, j);
}
newRows.Add(row);
}
// applied 1 column-fix; last column needs to have a width of 0
float [] newWidths = new float[newColumns];
System.Array.Copy(widths, 0, newWidths, 0, columns);
for (int j = columns; j < newColumns ; j++) {
newWidths[j] = 0;
}
columns = newColumns;
widths = newWidths;
rows = newRows;
}