I am trying to create a table with cells width a fixed width.
Let's say I have this code:
$table->addCell(300)->addText('first');
$table->addCell(300)->addText('text that is very looooooooong');
The first cell's 300 width is ignored and is crushed against the left side of the page like this:
f
i
r
s
t
My second cell is going to contain large texts, but I want that cell to maintain it's width.
I couldn't find it anywhere on the web so I am asking if somebody knows what I will have to do here.
Remeber that these values are TWIPS and 300 Twips are mere 5mm. Not enough room to hold more than 1 character.
Here is a calculator that helps you to convert values:
Also you might use the built in conversion functions in Shared\Font.php like this:
$helper= new PHPWord_Shared_Font();
//convert 5cm to Twips
$inTwips=$helper->centimeterSizeToTwips(5);
I have not tried this so far.