Replies: 6   Views: 5176
Table with no cell border
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  · 07-11-2018 - 11:35


You can use HTML attributes, CSS styles or a MS Word custom table style.

For example, the following script removes the border and set a border-collapse:


require_once 'classes/CreateDocx.php';

$docx = new CreateDocx();

$html = '
    table, th, td { border: 0; }
    table {border-collapse: collapse;}
        <tr width="600">
            <td style="background-color: yellow">1_1</td>
            <td rowspan="3" colspan="2">1_2</td>
        <tr width="600">
            <td>Some random text.</td>
        <tr width="600">
                    <li>Two <b>and a half</b></li>
        <tr width="600">


If you open the DOCX output with MS Word 2003 or newer or LibreOffice 5 or newer, you can check there's no border and the table is 'collapse'.

A very similar sample is included in the package (examples/Core/embedHTML folder).