Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jan 29, 2015 11:26 am

Hi there, I am using Spire.Doc to generate word documents.

I have a table with two columns and few rows. I want the first column to be certain width and i can do that. The issue is that the table is now smaller in size.

What I want is the table is full width of the page but one column is like 30% wide and other 70% wide. How can this be done? Is there any automatic option?

manageup
 
Posts: 1
Joined: Tue Jan 06, 2015 8:14 am

Fri Jan 30, 2015 3:10 am

Hello,

Thanks for your inquiry.
You can try the following code :
Code: Select all
PreferredWidth width = new PreferredWidth(WidthType.Percentage, 100);
table.PreferredWidth = width;
table.Rows[0].Cells[0].SetCellWidth(30, CellWidthType.Percentage);
table.Rows[0].Cells[1].SetCellWidth(70, CellWidthType.Percentage);

If there are any questions, welcome to get it back to us.

Best Regards,
Betsy
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Mon Feb 02, 2015 9:05 am

Hello,

Has the issue been resolved? Could you please give us some feedback if convenience?

Best Regards,
Betsy
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Doc