Forum


Replies: 3   Views: 3918
Embedhtml() ignores left and right table cell margins
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 truth@proposaltech.com  · 11-10-2013 - 21:20

<?php



$html = <<<EOF

<style>

table {

    border-spacing: 0;

    border-collapse: collapse;

}

td { 

    font-family: times new roman, arial, helvetica, sans-serif;

    font-size: 11pt; 

    vertical-align: top;

    margin-top: 1em;

    margin-bottom: 1em;

    margin-left: 2em;

    margin-right: .5em;

    border: 1px solid #000000;

}

</style>

<table>

<tr><td>1:1</td><td>1:2</td></tr>

<tr><td>2:1</td><td>2:2</td></tr>

</table>

EOF;

require_once('phpdocx_pro/classes/CreateDocx.inc');

$docx = new CreateDocx();

$docx->embedHTML($html);

$docx->createDocx('/tmp/testdocx');



?>



This produces a table with .15" top and bottom cell margins and .08" left and right cell margins. Regardless of what left and right margins are set to, the resulting table has .08" left and right margins.