本文整理汇总了C#中Table.AppendChild方法的典型用法代码示例。如果您正苦于以下问题:C# Table.AppendChild方法的具体用法?C# Table.AppendChild怎么用?C# Table.AppendChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.AppendChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DocxDocumentTableSchemeBuilder
internal DocxDocumentTableSchemeBuilder(WordprocessingDocument document, TableProperties contextTableProperties)
: base(document)
{
table = new Table();
if (contextTableProperties == null)
{
var borderType = new EnumValue<BorderValues>(BorderValues.Thick);
var tblProp = new TableProperties(
new TableBorders(
new TopBorder {Val = borderType, Size = 1},
new BottomBorder {Val = borderType, Size = 1},
new LeftBorder {Val = borderType, Size = 1},
new RightBorder {Val = borderType, Size = 1},
new InsideHorizontalBorder {Val = borderType, Size = 1},
new InsideVerticalBorder {Val = borderType, Size = 1}
)
);
table.AppendChild(tblProp);
}
else
table.AppendChild(contextTableProperties);
headerRow = new TableRow();
table.AppendChild(headerRow);
Aggregation.Add(table);
}
示例2: AddTable
public void AddTable(WordprocessingDocument package, DataTable table, TableStyle tableStyle)
{
Body body = package.MainDocumentPart.Document.Body;
// Create an empty table.
Table tbl = new Table();
// Set table width
SetTableWidth(tableStyle, tbl);
// Create a TableProperties object and specify its border information.
TableProperties tblProp = CreateTableProperties();
// Set table alignment
SetTableAlignment(tableStyle.Alignment, tblProp);
// Append the TableProperties object to the empty table.
tbl.AppendChild<TableProperties>(tblProp);
if (tableStyle.ShowTitle) {
AddTitleRow(table, tableStyle, tbl);
}
if (tableStyle.ShowHeader) {
AddHeaderRow(table, tbl, tableStyle);
}
AddRows(table, tableStyle, tbl, tblProp);
// Append the final table to the document body
body.Append(tbl);
}
示例3: Run
public static void Run()
{
// ExStart:InsertTableDirectly
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WorkingWithTables();
Document doc = new Document();
// We start by creating the table object. Note how we must pass the document object
// To the constructor of each node. This is because every node we create must belong
// To some document.
Table table = new Table(doc);
// Add the table to the document.
doc.FirstSection.Body.AppendChild(table);
// Here we could call EnsureMinimum to create the rows and cells for us. This method is used
// To ensure that the specified node is valid, in this case a valid table should have at least one
// Row and one cell, therefore this method creates them for us.
// Instead we will handle creating the row and table ourselves. This would be the best way to do this
// If we were creating a table inside an algorthim for example.
Row row = new Row(doc);
row.RowFormat.AllowBreakAcrossPages = true;
table.AppendChild(row);
// We can now apply any auto fit settings.
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
// Create a cell and add it to the row
Cell cell = new Cell(doc);
cell.CellFormat.Shading.BackgroundPatternColor = Color.LightBlue;
cell.CellFormat.Width = 80;
// Add a paragraph to the cell as well as a new run with some text.
cell.AppendChild(new Paragraph(doc));
cell.FirstParagraph.AppendChild(new Run(doc, "Row 1, Cell 1 Text"));
// Add the cell to the row.
row.AppendChild(cell);
// We would then repeat the process for the other cells and rows in the table.
// We can also speed things up by cloning existing cells and rows.
row.AppendChild(cell.Clone(false));
row.LastCell.AppendChild(new Paragraph(doc));
row.LastCell.FirstParagraph.AppendChild(new Run(doc, "Row 1, Cell 2 Text"));
dataDir = dataDir + "Table.InsertTableUsingNodes_out.doc";
// Save the document to disk.
doc.Save(dataDir);
// ExEnd:InsertTableDirectly
Console.WriteLine("\nTable using notes inserted successfully.\nFile saved at " + dataDir);
}
示例4: CreateTable
/// <summary>
/// Creates a new table in the document with the given dimensions and text in each cell.
/// </summary>
private Table CreateTable(Document doc, int rowCount, int cellCount, string cellText)
{
Table table = new Table(doc);
// Create the specified number of rows.
for (int rowId = 1; rowId <= rowCount; rowId++)
{
Row row = new Row(doc);
table.AppendChild(row);
// Create the specified number of cells for each row.
for (int cellId = 1; cellId <= cellCount; cellId++)
{
Cell cell = new Cell(doc);
row.AppendChild(cell);
// Add a blank paragraph to the cell.
cell.AppendChild(new Paragraph(doc));
// Add the text.
cell.FirstParagraph.AppendChild(new Run(doc, cellText));
}
}
return table;
}
示例5: InsertTableUsingNodeConstructors
public void InsertTableUsingNodeConstructors()
{
//ExStart
//ExFor:Table
//ExFor:Row
//ExFor:Row.RowFormat
//ExFor:RowFormat
//ExFor:Cell
//ExFor:Cell.CellFormat
//ExFor:CellFormat
//ExFor:CellFormat.Shading
//ExFor:Cell.FirstParagraph
//ExId:InsertTableUsingNodeConstructors
//ExSummary:Shows how to insert a table using the constructors of nodes.
Document doc = new Document();
// We start by creating the table object. Note how we must pass the document object
// to the constructor of each node. This is because every node we create must belong
// to some document.
Table table = new Table(doc);
// Add the table to the document.
doc.FirstSection.Body.AppendChild(table);
// Here we could call EnsureMinimum to create the rows and cells for us. This method is used
// to ensure that the specified node is valid, in this case a valid table should have at least one
// row and one cell, therefore this method creates them for us.
// Instead we will handle creating the row and table ourselves. This would be the best way to do this
// if we were creating a table inside an algorthim for example.
Row row = new Row(doc);
row.RowFormat.AllowBreakAcrossPages = true;
table.AppendChild(row);
// We can now apply any auto fit settings.
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
// Create a cell and add it to the row
Cell cell = new Cell(doc);
cell.CellFormat.Shading.BackgroundPatternColor = Color.LightBlue;
cell.CellFormat.Width = 80;
// Add a paragraph to the cell as well as a new run with some text.
cell.AppendChild(new Paragraph(doc));
cell.FirstParagraph.AppendChild(new Run(doc, "Row 1, Cell 1 Text"));
// Add the cell to the row.
row.AppendChild(cell);
// We would then repeat the process for the other cells and rows in the table.
// We can also speed things up by cloning existing cells and rows.
row.AppendChild(cell.Clone(false));
row.LastCell.AppendChild(new Paragraph(doc));
row.LastCell.FirstParagraph.AppendChild(new Run(doc, "Row 1, Cell 2 Text"));
doc.Save(MyDir + @"\Artifacts\Table.InsertTableUsingNodes.doc");
//ExEnd
Assert.AreEqual(1, doc.GetChildNodes(NodeType.Table, true).Count);
Assert.AreEqual(1, doc.GetChildNodes(NodeType.Row, true).Count);
Assert.AreEqual(2, doc.GetChildNodes(NodeType.Cell, true).Count);
Assert.AreEqual("Row 1, Cell 1 Text\r\nRow 1, Cell 2 Text", doc.FirstSection.Body.Tables[0].ToString(SaveFormat.Text).Trim());
}
示例6: EnsureRowMinimum
public void EnsureRowMinimum()
{
//ExStart
//ExFor:Row.EnsureMinimum
//ExSummary:Shows how to ensure a row node is valid.
Document doc = new Document();
// Create a new table and add it to the document.
Table table = new Table(doc);
doc.FirstSection.Body.AppendChild(table);
// Create a new row and add it to the table.
Row row = new Row(doc);
table.AppendChild(row);
// Ensure the row is valid (has at least one cell).
row.EnsureMinimum();
//ExEnd
}
示例7: CreateTable
//Create table that contain the mutation details and add it to body.
private static void CreateTable(Body body, List<Mutation> mutationList)
{
Table mutationTable = new Table();
mutationTable.AppendChild<TableProperties>(getTableProperties());
TableRow headerRow = new TableRow();
headerRow.Append(makeCell("Chromosome", 1));
headerRow.Append(makeCell("Position", 1));
headerRow.Append(makeCell("Gene Name", 1));
headerRow.Append(makeCell("Ref", 1));
headerRow.Append(makeCell("Var", 1));
headerRow.Append(makeCell("Ref Codon", 1));
headerRow.Append(makeCell("Var Codon", 1));
headerRow.Append(makeCell("Mutation", 1));
mutationTable.Append(headerRow);
foreach (Mutation m in mutationList)
{
int toColor = 0;
if (!m.CosmicName.Equals("-----"))
toColor = 2;
TableRow row = new TableRow();
row.Append(makeCell(m.Chrom, toColor));
row.Append(makeCell(m.Position + "", toColor));
row.Append(makeCell(m.GeneName, toColor));
row.Append(makeCell(m.Ref + "", toColor));
row.Append(makeCell(m.Var + "", toColor));
row.Append(makeCell(m.RefCodon, toColor));
row.Append(makeCell(m.VarCodon, toColor));
row.Append(makeCell(m.PMutationName, toColor));
mutationTable.Append(row);
}
body.Append(mutationTable);
}
示例8: SetTableWidth
private static void SetTableWidth(TableStyle tableStyle, Table tbl)
{
if (tableStyle.WidthUnit == TableStyle.TableWidthUnit.Percent) {
double percent = tableStyle.Width / 100D;
int wordPercent = (int)(5000 * (percent));
TableWidth width = new TableWidth() {
Type = TableWidthUnitValues.Pct,
Width = wordPercent.ToString()
};
tbl.AppendChild<TableWidth>(width);
}
}
示例9: DownloadDocx
public ActionResult DownloadDocx(FormCollection collection)
{
try
{
int counter = 1;
MemoryStream ms;
string cell_color = "";
// Create an empty table.
Table table = new Table();
// Create a TableProperties object and specify its border information.
TableProperties tblProp = new TableProperties(
new TableBorders(
new InsideHorizontalBorder()
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 1,
Color = "dddddd"
}
)
);
// Append the TableProperties object to the empty table.
table.AppendChild<TableProperties>(tblProp);
// Create a row.
while (!String.IsNullOrEmpty(collection["record_sha_" + counter++]))
{
if (String.Compare(collection["checkbox_" + (counter - 1).ToString()], "on") == 0)
{
TableRow tr = new TableRow();
if (counter % 2 == 1)
cell_color = "ffffff";
else if (counter % 2 == 0)
cell_color = "f9f9f9";
else
throw new Exception();
tr.Append(CreateTableCell(collection["record_message_" + (counter - 1).ToString()], cell_color, 8500));
tr.Append(CreateTableCell(collection["record_sha_" + (counter - 1).ToString()].Substring(0, 7), cell_color, 1000));
// Append the table row to the table.
table.Append(tr);
}
}
// Set up what is being recieved via the form
Dictionary<string, string> issueTypeList = new Dictionary<string, string>();
issueTypeList.Add("features_closed", "Features added in this release:");
issueTypeList.Add("closedNOTbelong", "Issues fixed in this release:");
issueTypeList.Add("openANDbelong", "Known issues created/found in this release:");
issueTypeList.Add("openNOTbelong", "Pre-existing issues not fixed in this release:");
using (ms = new MemoryStream())
{
using (WordprocessingDocument wordDocument = WordprocessingDocument.Create(ms, WordprocessingDocumentType.Document))
{
MainDocumentPart mainPart = wordDocument.AddMainDocumentPart();
mainPart.Document = new Document(new Body());
AddTitle("Release notes from " + collection["fromRelease"] + " to " + collection["toRelease"], mainPart.Document.Body, 40);
// Create the list issue data
foreach (KeyValuePair<string, string> listname in issueTypeList)
{
AddBlankLine(mainPart.Document.Body);
AddTitle(listname.Value, mainPart.Document.Body, 30);
AddList_FromFormData_ByTitle(collection, listname.Key, mainPart.Document.Body);
}
// Append the commit log table to the document.
AddBlankLine(mainPart.Document.Body);
AddTitle("The Commit Log:", mainPart.Document.Body, 30);
mainPart.Document.Body.Append(table);
}
}
return File(ms.ToArray(), "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Test.docx");
}
catch (Exception ex)
{
return View("Error");
}
}
示例10: GetTablePart
/// <summary>
/// This Method splits worksheet into a tables collection.
/// </summary>
/// <param name="excelWorksheet">Input Worksheet</param>
/// <param name="doc">Parent document</param>
/// <param name="tablePartList">ArrayList where tables will be stored</param>
/// <param name="columnStartIndex">Index of the column in Excel worksheet that will be the first column of Word table</param>
/// <param name="rowStartIndex">Index of the row in Excel worksheet that will be the first row of Word table</param>
/// <param name="columnCount">Column index of a last cell that contains data in the Excel worksheet</param>
/// <param name="rowCount">Row index of a last cell that contains data in the Excel worksheet</param>
private void GetTablePart( Worksheet excelWorksheet,
Document doc,
ArrayList tablePartList,
int columnStartIndex,
int rowStartIndex,
int columnCount,
int rowCount)
{
if (columnCount != 0 && rowCount != 0)
{
//Calculate max width of Words table.
//Then we will add columns to Word table while it's width is < maxWidth
Aspose.Words.PageSetup setup = doc.FirstSection.PageSetup;
double maxWidth = setup.PageWidth - setup.LeftMargin - setup.RightMargin;
int newColumnStartIndex = 0;
double currentWidth = 0;
for (int columnIndex = columnStartIndex; columnIndex <= columnCount; columnIndex++)
{
//Calculate width of current Word table
currentWidth += ConvertUtil.PixelToPoint(excelWorksheet.Cells.GetColumnWidthPixel(columnIndex));
newColumnStartIndex = columnIndex;
//If width of table > maxWidth then break loop
if (currentWidth > maxWidth && columnIndex != columnStartIndex)
{
break;
}
}
//Create a new Word table
Table wordsTable = new Table(doc);
//Loop through rows in the Excel worksheet
for (int rowIndex = rowStartIndex; rowIndex < rowCount; rowIndex++)
{
//Create new row
Aspose.Words.Tables.Row wordsRow = new Aspose.Words.Tables.Row(doc);
//Get cllection of Excel cells
Aspose.Cells.Cells cells = excelWorksheet.Cells;
//Set height of current row
wordsRow.RowFormat.Height = ConvertUtil.PixelToPoint(cells.GetRowHeightPixel(rowIndex));
//Append current row to current table.
wordsTable.AppendChild(wordsRow);
//Loop through columns and add columns to Word table while table's width < maxWidth
for (int columnIndex = columnStartIndex; columnIndex < newColumnStartIndex; columnIndex++)
{
//Convert Excel cell to Word cell
Aspose.Words.Tables.Cell wordsCell = ImportExcelCell(doc, cells, rowIndex, columnIndex);
//Insert cell into rhe row
wordsRow.AppendChild(wordsCell);
}
}
// We want the table to take only as much of the page as required.
wordsTable.PreferredWidth = PreferredWidth.Auto;
//Add Word table to ArrayList
tablePartList.Add(wordsTable);
if (newColumnStartIndex < columnCount)
{
//Start next table from newColumnStartIndex
GetTablePart(excelWorksheet, doc, tablePartList, newColumnStartIndex, rowStartIndex, columnCount, rowCount);
}
}
}
示例11: AddTable
// Add Table
public static Table AddTable(WordprocessingDocument document, DumpData[] data, int columns, int tablewidth, string tbtitle)
{
try
{
// Document handler
Document doc = document.MainDocumentPart.Document;
#region Table
// Create table and set properties
Table tb = new Table();
TableProperties tbp = specTablePropert(4, 1, 1);
tb.AppendChild<TableProperties>(tbp);
#endregion
#region tableTitle
TableRow trtitle = AddTableTitle(columns, tablewidth, tbtitle);
tb.Append(trtitle);
#endregion
doc.Body.Append(tb);
doc.Save();
return tb;
}
catch (Exception)
{
return null;
}
}
示例12: DownloadDoc
//[LoginFilter(Order = 0)]
//[SecurityFilter(Order = 1)]
// 下载回收油套管明细表
public void DownloadDoc(string id)
{
ReturningNotice notice = repository.FindByNotCache(id);
Account onlineAccount = UserSession.OnlineAccount;
if (notice == null)
{
Response.Write("无法找到指定的发料通知单");
}
String templateDir = Server.MapPath("~/Report/Template/Returning/");
String templateFile = "回收油套管明细表.docx";
FileInfo fi = new FileInfo(templateDir + templateFile);
if (!fi.Exists)
{
throw new FileNotFoundException("模板文件(" + templateFile + ")不存在,请联系系统管理员");
}
string desDir = Server.MapPath("~/Report/Output/Returning/");
string desFileName = string.Format("回收油套管明细{0}表{1}.docx", notice.Key, DateTime.Now.ToString("yyyyMMddHHmmssffff"));
DirectoryInfo di = new DirectoryInfo(desDir);
if (!di.Exists) { di.Create(); }
fi.CopyTo(desDir + desFileName);
#region Create Documnent
using (WordprocessingDocument doc = WordprocessingDocument.Open(desDir + desFileName, true, new OpenSettings { AutoSave = true }))
{
doc.MainDocumentPart.Document.Body.Descendants<Paragraph>().FirstOrDefault().Remove();
int i = 0;
int itemsPerPage = 25;
int recordsPageCount = notice.Records.Count / itemsPerPage;
if (notice.Records.Count % itemsPerPage != 0) { recordsPageCount += 1; }
recordsPageCount += 1;
//int curPage = 0;
float length = 0;
PipeType pipetype = null;
IPipeTypeRepository PipeTypeRepository = RepositoryFactory.GetRepository<IPipeTypeRepository, PipeType>();
string currentDigger = string.Empty;
Table table = null;
string instruction = notice.Instruction;
foreach (PipeReturningRecord r in notice.Records.OrderBy(por => por.DiggerName))
{
pipetype = PipeTypeRepository.FindById(r.Pipe);
length += Convert.ToSingle(r.Pipe.WorkLength.Value.ToString());
length = Convert.ToSingle(Math.Round(length, 2));
if (r.DiggerName != currentDigger)
{
table = new Table();
i = 0;
if (currentDigger != string.Empty)
{
doc.MainDocumentPart.Document.Body.AppendChild<Paragraph>(GenerateLastParagraph(instruction));
doc.MainDocumentPart.Document.Body.AppendChild<Paragraph>(GenerateBreakPageParagraph());
}
currentDigger = r.DiggerName;
string digger = r.DiggerName.ToString();
string a = r.ReturningNotice.Key.ToString().Substring(0,2);
DataTable dt=RepositoryFactory.GetRepository<IDetectionCompanyRepository, DetectionCompany>().company(a);
string company = dt.Rows[0]["name"].ToString();
//string company = onlineAccount.DetectionCompany.Name.ToString();
string date = r.DateCreated.ToString("yyyy-MM-dd");
string code = r.ReturningNotice.Key.ToString();
doc.MainDocumentPart.Document.Body.AppendChild<Paragraph>(GenerateReportDataHeadParagraph(digger));
doc.MainDocumentPart.Document.Body.AppendChild<Paragraph>(GenerateLastParagraph(company, date, code));
table = GenerateBasiceReportDataTable();
#region 表头
table.Elements<TableRow>().First().Remove();
TableRow row1 = new TableRow();
TableRow row2 = new TableRow();
row1.AppendChild<TableCell>(BuildCell("序号", 1, new VerticalMerge { Val = MergedCellValues.Restart }, true));
row2.Append(BuildCell(string.Empty, 1, new VerticalMerge()));
row1.AppendChild<TableCell>(BuildCell("自编号", 1, new VerticalMerge { Val = MergedCellValues.Restart }, true));
row2.Append(BuildCell(string.Empty, 1, new VerticalMerge()));
row1.AppendChild<TableCell>(BuildCell("规格", 1, new VerticalMerge { Val = MergedCellValues.Restart }, true));
row2.Append(BuildCell(string.Empty, 1, new VerticalMerge()));
row1.AppendChild<TableCell>(BuildCell("纲级", 1, new VerticalMerge { Val = MergedCellValues.Restart }, true));
//.........这里部分代码省略.........
示例13: GenerateTableFormDB
void GenerateTableFormDB()
{
using (WordprocessingDocument myDoc = WordprocessingDocument.Open(docName, true)) {
MainDocumentPart mainPart = myDoc.MainDocumentPart;
Document doc = mainPart.Document;
//Create new table with predefined table style
Table table = new Table();
TableProperties tblPr = new TableProperties();
TableStyle tblStyle = new TableStyle() { Val = "MyTableStyle" };
tblPr.AppendChild(tblStyle);
table.AppendChild(tblPr);
string[] headerContent = new string[] { "Code", "Name", "Scientific Name" };
//Create header row
TableRow header = CreateRow(headerContent);
table.AppendChild(header);
//Connect to database
BirdTrackDataContext db = new BirdTrackDataContext();
var btoQuery =
from b in db.btos
select b;
//For every product in my database create a new row in my table
foreach (var item in btoQuery) {
// price += Math.Round(item.ListPrice, 2);
string[] content = new[] { item.bto_code,
item.species_name,
item.scientific_name};
TableRow tr = CreateRow(content);
table.AppendChild(tr);
}
doc.Body.AppendChild(table);
doc.Save();
}
}
示例14: AddTable
// Take the data from a two-dimensional array and build a table at the
// end of the supplied document.
public static void AddTable(WordprocessingDocument document, string[,] data)
{
var doc = document.MainDocumentPart.Document;
var table = new Table();
var props = new TableProperties(
new TableWidth()
{
Width = "100%"
},
new TableBorders(
new TopBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 1
},
new BottomBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 1
},
new LeftBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 0
},
new RightBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 0
},
new InsideHorizontalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 1
},
new InsideVerticalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 1
}));
table.AppendChild(props);
var numberOfRows = data.GetUpperBound(0);
var numberOfColumns = data.GetUpperBound(1);
var columnPercent = (100 / (numberOfColumns + 1)).ToString();
for (var i = 0; i <= numberOfRows; i++)
{
var tr = new TableRow();
for (var j = 0; j <= numberOfColumns; j++)
{
var tc = new TableCell(new TableCellWidth() { Width = columnPercent });
tc.Append(new Paragraph(new Run(new Text(data[i, j]))));
// Assume you want columns that are automatically sized.
tc.Append(new TableCellProperties(
new TableCellWidth { Type = TableWidthUnitValues.Pct }));
tr.Append(tc);
}
table.Append(tr);
}
doc.Body.Append(table);
}
示例15: AddTable
private static void AddTable(string fileName, string[,] data)
{
using (var document = WordprocessingDocument.Open(fileName, true))
{
var doc = document.MainDocumentPart.Document;
Table table = new Table();
TableProperties props = new TableProperties(
new TableBorders(
new TopBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new BottomBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new LeftBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new RightBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideHorizontalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideVerticalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
}));
table.AppendChild<TableProperties>(props);
for (var i = 0; i <= data.GetUpperBound(0); i++)
{
var tr = new TableRow();
for (var j = 0; j <= data.GetUpperBound(1); j++)
{
var tc = new TableCell();
tc.Append(new Paragraph(new Run(new Text(data[i, j]))));
// Assume you want columns that are automatically sized.
tc.Append(new TableCellProperties(
new TableCellWidth { Type = TableWidthUnitValues.Auto }));
tr.Append(tc);
}
table.Append(tr);
}
doc.Body.Append(table);
doc.Save();
}
}