This project has moved. For the latest updates, please go here.

Setting width of table in percentage

Aug 21, 2014 at 2:20 PM
Can I set width of a table in percentage? I tried but it doesn't seem to work.
Aug 22, 2014 at 1:16 PM
Edited Sep 2, 2014 at 8:52 PM
You can work out the available space on your page and then set the cell width based on that. So to set a cell's width as 10%, you could do something like:
float availableSpace = DocX.PageWidth - DocX.MarginLeft - DocX.MarginRight;
Cell.Width = availableSpace * 0.1f;
Aug 22, 2014 at 8:53 PM
Neat. I will try this.