代码如下所示:
代码如下:
//Open document and create Documentbuilder
Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Set table formating
//Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
//Set left indent
builder.RowFormat.LeftIndent = 100;
// etc...
//Move documentBuilder cursor to the bookmark
builder.MoveToBookmark("myBookmark");
//Insert some table
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
builder.InsertCell();
builder.Write("this is cell");
}
builder.EndRow();
}
builder.EndTable();
//Save output document
doc.Save("demo2.doc");
您可能感兴趣的文章:asp.net下用Aspose.Words for .NET动态生成word文档中的数据表格的方法asp.net下用Aspose.Words for .NET动态生成word文档中的图片或水印的方法.net使用Aspose.Words进行Word替换操作的实现代码利用Aspose.Word控件实现Word文档的操作C# 利用Aspose.Words.dll将 Word 转成PDF使用Aspose.Cells组件生成Excel文件实例使用aspose.word 第三方的插件实现导出wordC#使用Aspose.Cells控件读取Excel
words
aspose
表格
方法