If you have CellPadding in the first table and you add a PdfPTable, it go over the first table, how to resolve?
i would try with setOffset but there isn't in PdfPTable...

excuse my english, i attach my exmple

begin--------------------------------------------------------------
import java.awt.Color;
import java.awt.Point;
import java.io.*;

import com.lowagie.text.*;
import com.lowagie.text.pdf.*;

public class MC_test {

public static void main(String arg[]) {
Document.compress = false;
try {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
PdfWriter.getInstance(document, new FileOutputStream("c:\\test.pdf"));
document.open();

Table aTable = null;

// test 1 : simple table
aTable = new Table(2,2); // 2 rows, 2 columns
aTable.setCellpadding(0);

aTable.addCell("0.0");
aTable.addCell("0.1");
aTable.addCell("1.0");
aTable.addCell("1.1");
document.add(aTable);
System.out.println("\n --------------------- test1 done");

PdfPTable pTable = new PdfPTable(2);
pTable.getDefaultCell().setPadding(0);
pTable.addCell("aa");
pTable.addCell("bb");
pTable.addCell("aa");
pTable.addCell("bb");
document.add(pTable);

document.newPage();

aTable = new Table(2,2); // 2 rows, 2 columns
aTable.setCellpadding(2);
aTable.addCell("0.0");
aTable.addCell("0.1");
aTable.addCell("1.0");
aTable.addCell("1.1");
document.add(aTable);
System.out.println("\n --------------------- test2 done");

pTable = new PdfPTable(2);
pTable.getDefaultCell().setPadding(2);
pTable.addCell("aa");
pTable.addCell("bb");
pTable.addCell("aa");
pTable.addCell("bb");
document.add(pTable);

document.close();
}
catch(Exception de) {
de.printStackTrace();
System.out.println(de.toString());
}

}
}

end--------------------------------------------------------------


--
Marco Ceccarelli - Programmatore
TNX.it - Internet & Multimedia

--
Marco Ceccarelli - Programmatore
TNX.it - Internet & Multimedia



-------------------------------------------------------
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to