views:

30

answers:

1

I have a table that I'm creating in iTextSharp and populating with data at runtime. The number of columns are variable and the text in them could be any size.

When I create the table at the moment, the columns are the same size. However, some columns have wasted space and others have cramped content. I want the columns to automatically resize themselves to best contain their content.

var table = new PdfPTable(columnCount) { WidthPercentage = 100};

How can I get my desired behaviour?

A: 

It seems you can't autosize the columns. You can however, give columns relative widths or weights.

GiddyUpHorsey