npoi 在word中创建的table怎么在页面设置居中
1个回答
展开全部
static void Main(string[] args)
{
XWPFDocument doc = new XWPFDocument();
XWPFTable table = doc.CreateTable(3, 3);
table.GetRow(1).GetCell(1).SetText("EXAMPLE OF TABLE");
XWPFParagraph p1 = doc.CreateParagraph();
XWPFRun r1 = p1.CreateRun();
r1.SetBold(true);
r1.SetText("纯笑The quick brown fox"圆裤悉);
r1.SetBold(true);
r1.SetFontFamily("橘乎Courier");
r1.SetUnderline(UnderlinePatterns.DotDotDash);
r1.SetTextPosition(100);
table.GetRow(0).GetCell(0).SetParagraph(p1);
table.GetRow(2).GetCell(2).SetText("only text");
FileStream out1 = new FileStream("simpleTable.docx", FileMode.Create);
doc.Write(out1);
out1.Close();
}
{
XWPFDocument doc = new XWPFDocument();
XWPFTable table = doc.CreateTable(3, 3);
table.GetRow(1).GetCell(1).SetText("EXAMPLE OF TABLE");
XWPFParagraph p1 = doc.CreateParagraph();
XWPFRun r1 = p1.CreateRun();
r1.SetBold(true);
r1.SetText("纯笑The quick brown fox"圆裤悉);
r1.SetBold(true);
r1.SetFontFamily("橘乎Courier");
r1.SetUnderline(UnderlinePatterns.DotDotDash);
r1.SetTextPosition(100);
table.GetRow(0).GetCell(0).SetParagraph(p1);
table.GetRow(2).GetCell(2).SetText("only text");
FileStream out1 = new FileStream("simpleTable.docx", FileMode.Create);
doc.Write(out1);
out1.Close();
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询