Forum


Replies: 1   Views: 2383
Tables not autofitting content
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 tbenbow  · 23-09-2018 - 02:47

Autofit worked fine in version 3.  Updated to version 8 and the same php script wasnt autofitting content to the tables.  I tried forcing the tableLayout property to "autofit' but that failed as well.

Finally, I jsut downloaded the sampe script from the api documenation, and that failed to autofit as well.  So, I'm convniced its not my script.  

Code for table attached (from api).  

<?php require_once 'phpdocx/classes/CreateDocx.php';
$docx = new CreateDocx();

$valuesTable = array(
    array(
        11,12,13,14
    ),
    array(
        21,22,23,24
    ),
    array(
        31,32,33,34
    ),
);
$paramsTable = array(
    'border' => 'single',
    'tableAlign' => 'center',
    'borderWidth' => 10,
    'borderColor' => 'B70000',
    'textProperties' => array('bold' => true, 'font' => 'Algerian', 'fontSize' => 18),
);
$docx->addTable($valuesTable, $paramsTable);

$docx->createDocx('example_addTable_1'); 

$direc = 'phpdocx/Proposal';

$docx->createDocx('Proposal'); 
header('Location: /Proposal.docx');   
?>