Forum


Replies: 5   Views: 4834
Columnwidths is not respected
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by IanTechnoReadapt  · 22-06-2014 - 18:32

Hi, I'm trying to have a table with fixed column width, but even though I set 'columnWidths' => array(1000, 3850, 3850), 'tableLayout' => 'fixed' as soon the text get wider than the width, instead of increasing the cell height, the table's column get wider. I'm not sure what to do. Thanks

Posted by admin  · 23-06-2014 - 14:57

Hello, Please send us a script we can run to check the issue. We have done some tests and we see everything fine using the columnWidths option. Regards.

Posted by IanTechnoReadapt  · 23-06-2014 - 18:38

modified sample_1.php as follow and the rows aren't equal: http://technoreadapt.com/sample_1.zip

Posted by admin  · 24-06-2014 - 11:52

Hi, The sample is working fine. The issue is how Word works; as you can see in your document, the column witdh is as small as the largest word. Although you set a fixed column size, this size will be at least as small as the larger word inside the column. You could set a small font or use smaller words inside the table. Regards.

Posted by IanTechnoReadapt  · 24-06-2014 - 16:35

Well if I resize the column in word, the words get truncated, is there a way to have the same behavior?

Posted by admin  · 25-06-2014 - 07:13

Hello, We have done some tests and by default Word doesn't truncate the words when you resize the table, and it works as phpdocx does. What version of MS Word are you using to create the document? Please post a DOCX that truncate the words in a table. Regards.