Forum


Replies: 1   Views: 1917
Table border issues, collapse does not work
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 marius.janulaitis  · 24-02-2020 - 13:34

Hi,

i set table border size 1 also using "border-collapse: collapse", but with Open Office borders looks very big.
Also doesn't seem to work "collapse". How to create default (single) table border?
phpdocx version is 9.5.
 

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

$docx->modifyPageLayout('A4');

$html = 'Some random text START ....<br>
Text new line
<table width="600" border="1" style="border-collapse: collapse;">
        <tbody>
                <tr>
                        <td width="278">Test 1</td>
                        <td width="22" align="center">x</td>
                        <td width="278">Test 1 2</td>
                        <td class="c-val" width="22"><br></td>
                </tr>
                <tr>
                        <td width="278">Test 2 1</td>
                        <td width="22" align="center">x</td>
                        <td width="278">Test 2 2</td>
                        <td class="c-val" width="22"><br></td>
                </tr>
        </tbody>
</table>
Some random text ENT ....<br>
Text new line';

$docx->embedHTML($html);
$docx->createDocx('output');