Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting height for table in iTextSharp

Tags:

c#

pdf

itext

I've created a table with 2 columns. In the second cell of the first row I want to insert another table that have only one cell. The problem is that I can't set the height of the second table. It stretches more than the content height. Its height is equal with the cell height where it was added.

like image 255
Emanuel Avatar asked Sep 23 '11 07:09

Emanuel


2 Answers

Table's height depends on its parent container. So you should set height of the parent cell. You can do this in two ways:

cell.MinimumHeight = 50f;

or

 cell.FixedHeight = 70f;
like image 138
algreat Avatar answered Nov 14 '22 06:11

algreat


The height of the table cannot be set, the height of the table is determined by the height of its cells (you can set the height-property of a cell). You could add an empty cell to the second table if you want to stretch this table.

like image 27
Robin van der Knaap Avatar answered Nov 14 '22 05:11

Robin van der Knaap