public void CreateRowsAndColumns()
{
SpreadsheetDocument doc = new SpreadsheetDocument ();
doc.New ();
Table table = new Table (doc,"tab1","tab1");
for(int i=1; i<=4; i++)
{
for(int j=1; j<=5;j++)
{
Cell cell = table.CreateCell ();
cell.OfficeValueType ="float";
Paragraph paragraph = new Paragraph (doc);
string text= (j+i-1).ToString();
paragraph.TextContent .Add (new SimpleText ( doc,text));
cell.Content.Add(paragraph);
cell.OfficeValueType = "string";
cell.OfficeValue = text;
table.InsertCellAt (i, j, cell);
}
}
Assert.AreEqual(5, table.Rows.Count);
for (int i = 1; i < 4; i++)
{
Row row = table.Rows[i];
Assert.AreEqual(6, row.Cells.Count);
}
}