AODL.Utils.ContentMocker.CreateTextDocumentTable C# (CSharp) Method

CreateTextDocumentTable() private method

Creates the text document table.
private CreateTextDocumentTable ( AODL document, string tableName, string styleName, int rows, int columns, double width, Table originalTable ) : Table
document AODL The document.
tableName string Name of the table.
styleName string Name of the style.
rows int The rows.
columns int The columns.
width double The width.
originalTable AODL.Document.Content.Tables.Table
return AODL.Document.Content.Tables.Table
		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;
		}