[英]How to make the table non breaking using iTextSharp
我有一張桌子
PdfPTable tblSummary = new PdfPTable(1);
它確實有2個嵌套在其中的表。 如何使tblSummary
作為一個整體出現( 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的表,所以可以確定表的內容不會超過頁面高度。
任何建議都會有所幫助。
你試過這個:
tblSummary.KeepTogether = true;
PdfPTable tabla = new PdfPTable(2);
float[] anchosTablaTituloDescripcion = new float[] { 4f, 4f };
tabla.SetWidths(anchosTablaTituloDescripcion);
tabla.WidthPercentage = 100;
tabla.KeepTogether = true;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.