Click here to Skip to main content
15,745,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Someone have some idea to modify the with of cell?
i try with
table.Rows[1].Cells[1].Width = 1000;


table.Rows[1].Cells[1].Width = 1000.0;
Durrett 22-Aug-17 4:33am    
I've previously used DocX library, but unfortunately it can create an invalid files (ones that do not follow OpenXML specification). Now if you're only going to open the resulting DOCX files in MS Word then its OK to use it, because MS Word can silently repair them. But if you're going to use some other Word processing application (for instance OpenOffice Writer) then it can fail to open them. Instead I would suggest you to try some different approach, for instance with a C# / VB.NET library for Word like the following:

table.Rows[1].Cells[1].CellFormat.PreferredWidth =
    new TableWidth(100, TableWidthUnit.Point);

Also here are some additional examples of DOCX in C# / VB.NET.

1 solution

Share this answer
Member 11822400 15-Jul-15 2:37am    
thanks for help but it don't work with DocX Library

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900