private Table CreateTextDocumentTable(
AODL.Document.TextDocuments.TextDocument document,
string tableName,
string styleName,
int rows,
int columns,
double width,
Table originalTable)
{
string tableCnt = document.DocumentMetadata.TableCount.ToString();
Table table = new Table(document, tableName, styleName);
table.TableStyle.TableProperties.Width = width.ToString().Replace(",",".")+"cm";
for(int i=0; i < columns; i++)
{
Column column = new Column(table, originalTable.ColumnCollection[i].StyleName);
//column.ColumnStyle.ColumnProperties.Width = GetColumnCellWidth(columns, width);
table.ColumnCollection.Add(column);
}
for(int ir=0; ir < rows; ir++)
{
Row row = new Row(table, originalTable.Rows[ir].StyleName);
for(int ic=0; ic < columns; ic++)
{
Cell cell = new Cell(table.Document, originalTable.Rows[ir].Cells[ic].StyleName);
//if (useBorder)
// cell.CellStyle.CellProperties.Border = Border.NormalSolid;
row.Cells.Add(cell);
}
table.Rows.Add(row);
}
return table;
}