Skip to content Skip to sidebar Skip to footer

How To Put Image And Text Inside 1 Cell In IText Android Table?

How to put image and text below/above it? I tried below code but I only can see 'Test 1' and 'Test 3' private void createTable(Paragraph paragraph, Document document){ PdfPTabl

Solution 1:

You should try this:

PdfPTable table = new PdfPTable(2);  
PdfPCell cell = new PdfPCell();
Paragraph paragraph1 = new Paragraph();
paragraph1.add(textAnswer);
cell.addElement(paragraph1);
cell.addElement(new Paragraph("Test 1"));
cell.addElement(imageAnswer);
cell.addElement(new Paragraph("Test 3"));
table.addCell(cell);

If that doesn't work, please provide a SSCCE that reproduces the problem in Java.


Post a Comment for "How To Put Image And Text Inside 1 Cell In IText Android Table?"