How to add text to table cell in Aspose.Note using C#.
Below is the incomplete code:
Aspose.Note.License license = new Aspose.Note.License();
license.SetLicense(“Aspose.Notefor.NET.lic”);
Document doc = new Document();
// Initialize Page class object
Page page = new Page();
// Initialize Title class object
Title title = new Title();
// Initialize TextStyle class object and set formatting properties
ParagraphStyle defaultTextStyle = new ParagraphStyle
{
FontColor = Color.Black,
FontName = "Arial",
FontSize = 10
};
RichText titleText = new RichText() { ParagraphStyle = defaultTextStyle }.Append("Page 1");
title.TitleText = titleText;
// Set page title
page.Title = title;
// Initialize TableRow class object
TableRow row1 = new TableRow();
// Initialize TableCell class objects
TableCell cell11 = new TableCell();
TableCell cell12 = new TableCell();
TableCell cell13 = new TableCell();
// Table cells to rows
row1.AppendChildLast(cell11);
row1.AppendChildLast(cell12);
row1.AppendChildLast(cell13);
// Initialize Table class object and set column widths
Table table = new Table()
{
IsBordersVisible = true,
Columns = { new TableColumn { Width = 200 }, new TableColumn { Width = 200 }, new TableColumn { Width = 200 } }
};
// Append table rows to table
table.AppendChildLast(row1);
// Initialize Outline object
Outline outline = new Outline()
{
VerticalOffset = 20,
HorizontalOffset = 5
};
// Initialize OutlineElement object
OutlineElement outlineElem = new OutlineElement();
// Add table to outline element node
outlineElem.AppendChildLast(table);
// Add outline element to outline
outline.AppendChildLast(outlineElem);
// Add outline to page node
page.AppendChildLast(outline);
// Add Page node
doc.AppendChildLast(page);
doc.Save("C:\\Temp\\OneNote\\SampleText-17.one");