Forum


Replies: 3   Views: 535
Template with fixed height table rows
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 admin  · 30-06-2023 - 15:07

Hello,

Yes, you can use the height option applied to specific rows.

The following sample set a height of 1cm for the second row:

$trProperties = array();
// the second position of the array is the second row
$trProperties[1] = array(
    'height' => 567,
);

$values = array(
    array(
        11,
        12,
        13,
        14
    ),
    array(
        21,
        22,
        23,
        24
    ),
    array(
        31,
        32,
        33,
        34
    ),

);

$docx->addTable($values, array(), $trProperties);

As a fixed height (Exactly value) is applied to the row, if you add extra content into the cell higher than the row height it won't appear.

If needed you can also set fixed width sizes for the table and columns.

Regards.