2015-10-06 89 views
0

我想使表格單元格中的文本對齊到單元格的底部。我沒有在tablecell屬性中的任何位置看到此選項。這是構建該表的代碼片段。對齊單元格,使文本在底部對齊

 Table thirdTable = section.Headers.Primary.AddTable(); 

     thirdTable.Format.Font.Size = "7pt"; 

     column = thirdTable.AddColumn("1.5cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     column = thirdTable.AddColumn("1cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     column = thirdTable.AddColumn("7cm"); 
     column.Format.Alignment = ParagraphAlignment.Left; 

     column = thirdTable.AddColumn("2.5cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     column = thirdTable.AddColumn("1cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     column = thirdTable.AddColumn("1.5cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     column = thirdTable.AddColumn("1.5cm"); 
     column.Format.Alignment = ParagraphAlignment.Center; 

     row = thirdTable.AddRow(); 
     row = thirdTable.AddRow(); 

     row.Cells[0].AddParagraph("Segment Code"); 
     row.Cells[1].AddParagraph("Milepoint"); 
     row.Cells[2].AddParagraph("Description of Milepoint"); 
     row.Cells[3].AddParagraph("City Name"); 
     row.Cells[4].AddParagraph("Segment Code"); 
     row.Cells[5].AddParagraph("Milepoint"); 
     row.Cells[6].AddParagraph("FA Route Number"); 

回答

0

嗯,我終於找到了,這是盈我的臉整個時間。我錯過了它。

它在本示例文檔中進行了介紹。

這是我的代碼現在看起來像

 row.Cells[0].AddParagraph("Segment Code"); 
     row.Cells[0].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[1].AddParagraph("Milepoint"); 
     row.Cells[1].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[2].AddParagraph("Description of Milepoint"); 
     row.Cells[2].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[3].AddParagraph("City Name"); 
     row.Cells[3].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[4].AddParagraph("Segment Code"); 
     row.Cells[4].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[5].AddParagraph("Milepoint"); 
     row.Cells[5].VerticalAlignment = VerticalAlignment.Bottom; 
     row.Cells[6].AddParagraph("FA Route Number"); 
     row.Cells[6].VerticalAlignment = VerticalAlignment.Bottom;