0
votes

I'm trying to create Pdf from java using iText.

How Can I Add two cells to a table when the second cell will begin immediate after the first cell , and Not in the middle of the row..?

Right now when creating 2 cells each of them take 50% of the row

Please advice, Thanks!

1

1 Answers

1
votes

It's not possible to have the column width change dynamically based on the text it contains, if that's your question.

A quick and simple fix would be to define relative widths

new PdfPTable(new float[] { 1, 2 });

or

table.setWidths(new float[] { 1, 2 });