Juha
1
Hello,
I created a dynamic table on the fly, how can I add text to a tablecell?
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.StartTable();
builder.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
builder.CellFormat.Width = 100;
for (int Count = 1; Count <= numberOfStudents; Count++)
{
for (int Count2 = 1; Count2 <= numberOfPlannedCourses; Count2++)
{
builder.InsertCell();
}
builder.EndRow();
}
builder.EndTable();
Hi
Thanks for your inquiry. Try using the following code.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.StartTable();
builder.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
builder.CellFormat.Width = 100;
for (int Count = 1; Count <= numberOfStudents; Count++)
{
for (int Count2 = 1; Count2 <= numberOfPlannedCourses; Count2++)
{
builder.InsertCell();
builder.Write("some text in cell");
}
builder.EndRow();
}
builder.EndTable();
Also see the following link
https://docs.aspose.com/words/net/introduction-and-creating-tables/
I believe that this will help you.
Best regards.