Is there a way to adjust the column width automatically to place as much content in them as they can (sort of like double-clicking on the column width is grid control).
I am setting them as percentages at the moment, but since there is different content depending on the search criteria, I would like the column width to fit accordingly.
I am currently setting the width as shown below:
var table = new PdfPTable(9) {WidthPercentage = 100}; var colWidthPercentages = new[] {6f, 10f, 10f, 10f, 20f, 20f, 8f, 8f, 8f}; table.SetWidths(colWidthPercentages);
Does anyone know how to do this, or if not, the way to find out the optimal column width should match its content?
c # itext column-width
Michal ciechan
source share