原創|其它|編輯:郝浩|2012-10-12 13:42:03.000|閱讀 4607 次
概述:Aspose.Words可以在word文檔中輕松創建表格,這里介紹一個具體操作實例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.Words可以在Word文檔中輕松創建表格,只需添加如下代碼:
//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");
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:xiehuan_uestc的專欄-csdn