AddTable
Adds an empty table to the end of the collection. Add rows with TableRowCollection.Add.
| myBlockCollection.AddTable(options?: object):Table
|
Parameters
object options optional
Table properties to set.
Returns
The new table.
Examples
Create a table with a row for each order line
| var writer = new Writer();
var table = writer.Sections.Add().Blocks.AddTable();
$Xml.SelectAll('Lines/Line', function (line) {
var row = table.Rows.Add();
row.Cells.Add().Blocks.AddParagraph().Inlines.AddRun({ Text : line.Evaluate('Product') });
row.Cells.Add().Blocks.AddParagraph().Inlines.AddRun({ Text : line.Evaluate('Quantity') });
});
|
See Also