【发布时间】:2011-12-31 01:39:35
【问题描述】:
我有一张桌子
PdfPTable tblSummary = new PdfPTable(1);
它确实有 2 个嵌套在其中的表。如何使tblSummary 整体显示(行不得中断到另一页)或如果当前页面不适合将整个表转移到另一页。
我试过SplitLate和SplitRows
而我的代码是这样的
PdfPTable tblSummary = new PdfPTable(1);
PdfPCell csummarycell = new PdfPCell();
PdfPTable tblSummaryFirst = new PdfPTable(3);
.
.
csummarycell.AddElement(tblSummaryFirst);
.
.
tblSummary.AddCell(csummarycell);
tblSummary.SplitLate = true;
tblSummary.SplitRows = false;
像这样,我在 tblSummary 中添加了一个表,而结果表的高度总是小于 pagesize 的高度,因此可以确定表的内容不会超过页面高度。
任何建议都会很有帮助。
【问题讨论】:
标签: c# itextsharp pdfptable