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