How to set the cell width in itextsharp pdf creation

后端 未结 4 1645
广开言路
广开言路 2020-12-18 23:35

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

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 23:39

    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

提交回复
热议问题