2015-02-11 45 views
0

我有一个有3列的表,它有大约10行。但是我想要做的是在特定行之后跳过一行。在特定行后跳过一个额外的行

这是我的代码;

Paragraph paragraphTable3 = new Paragraph(); 
paragraphTable3.SpacingBefore = 20f; 
paragraphTable3.SpacingAfter = 10f; 

PdfPTable third_table = new PdfPTable(3); 
third_table.TotalWidth = 560f; 
third_table.LockedWidth = true; 
third_table.SetWidths(new float[] { 2.4f,0.1f, 6.6f }); 

third_table.AddCell(new PdfPCell(new Phrase("Responsibilities Held ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(": ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(Responsibilities_held, other)) { BorderWidth = 0 }); 

third_table.AddCell(new PdfPCell(new Phrase("Description of Work Done", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(": ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(Description_of_work_done, other)) { BorderWidth = 0 }); 

我得到这样的输出;

Responsibilities Held   : Blah bluh bluh bluh bluh ............................ 
            bluh ..........bluh ... 

Description of Work Done  : Blu....................................h.............. 
            bluh......................... 

Present Address     : Blu....................................h.............. 
            bluh.........................Extra space after here 

Additional Qualifications  : Blu....................................h.............. 
            bluh......................... 

我想以后现住址,以增加额外的空间

请帮我.... 谢谢

+0

@DKKoch避免编辑会改变含义。插入只是跳过。 – SimpleVar 2015-02-11 06:27:39

+2

如果您希望我们能够了解您的情况,您必须告诉我们您的期望和目前正在获得的信息。 – SimpleVar 2015-02-11 06:28:36

+0

我是这样得出来的; – 2015-02-11 06:45:53

回答

1

如果您想在两行之间添加一些额外的空间,为什么不添加一个固定高度的额外(空)行?

我把你的代码片断添加到表中的两行,并且我在这两行之间添加了一个带有colspan 3的额外单元。我将这行的高度定义为30个用户单位(对应于30个点):

PdfPTable third_table = new PdfPTable(3); 
third_table.TotalWidth = 560f; 
third_table.LockedWidth = true; 
third_table.SetWidths(new float[] { 2.4f,0.1f, 6.6f }); 

third_table.AddCell(new PdfPCell(new Phrase("Responsibilities Held ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(": ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(Responsibilities_held, other)) { BorderWidth = 0 }); 

PdfPCell cell = new PdfPCell(); 
cell.Colspan = 3; 
cell.FixedHeight = 30.0f; 
third_table.AddCell(cell); 

third_table.AddCell(new PdfPCell(new Phrase("Description of Work Done", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(": ", other)) { BorderWidth = 0 }); 
third_table.AddCell(new PdfPCell(new Phrase(Description_of_work_done, other)) { BorderWidth = 0 }); 
0

您可以使用paddingBottom来作为细胞性质是这样的。

new PdfPCell(new Phrase("Responsibilities Held ", other)) { BorderWidth = 0, PaddingBottom = 10f }