表格样式

try
{
string fileStream = @"D:\moban\tempA31.docx";

Document document = new Document(fileStream);
DocumentBuilder builder = new DocumentBuilder(document);
builder.Write("\n");
for (int i = 0; i < 200; i++)
{


builder.MoveToDocumentEnd();
builder.Write("\n");
builder.StartTable();

builder.CellFormat.Borders.Color = Color.Black;
builder.RowFormat.Height = 80;
builder.CellFormat.Borders.LineWidth = 1.5;
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
//builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.InsertCell();


//builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
//builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;

builder.EndRow();

}


document.Save(@"D:\moban\TEST.docx");
}
catch (Exception)
{

throw;
}

你可能感兴趣的:(表格样式)