Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How can I set cell width and height in itextsharp pdf cell ceration using c#. I just use

cell.width = 200f;

But it should display the error message.

width can not be set.

What should I do?..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

You don't set the width of a cell.

you should set the width of the columns. And you can do that by applying them on the table object:

float[] widths = new float[] { 1f, 2f };
table.SetWidths(widths);

The answer from Neha is to set the width of the table object

more reference material here: http://www.mikesdotnetting.com/Article/86/iTextSharp-Introducing-Tables


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...