Forum


Replies: 8   Views: 3763
Cant create tables
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 vicente  · 28-10-2013 - 20:03

Hello, i bougth the pro version, everithing ok until i create tables, via html or addTable, it creates the document but it says that it's damaged and wont open.



i tried with styles, no styles, html, and eery documentation u have in your site but in the moment i create a table it crashes.


Posted by jorgelj  · 29-10-2013 - 09:43

Hello,



Please try one of the included examples and post if it opens fine.



Regards.


Posted by vicente  · 30-10-2013 - 17:17

hello again, i've tried those examples but they wont go.



Im using cakephp.



 


Posted by vicente  · 30-10-2013 - 17:23

the code of my document it's very extensive, its working ok but in the momente i put this it crashes
[code]
$doc.= '

















';


$docx->embedHTML($doc, array('downloadImages' => true));
if($docx->createDocx($nombreCotizacion)){
echo "ok";

}[/code]

Posted by vicente  · 30-10-2013 - 17:24

$doc.= '<table width="500" border="0" cellspacing="0" cellpadding="0">

                <tr>

                  <td></td>

                  <td></td>

                </tr>

                <tr>

                  <td></td>

                  <td></td>

                </tr>

                <tr>

                  <td></td>

                  <td></td>

                </tr>

                <tr>

                  <td></td>

                  <td></td>

                </tr>

              </table>

              ';

            



            $docx->embedHTML($doc, array('downloadImages' => true));

            if($docx->createDocx($nombreCotizacion)){

                echo "ok";

                

            }


Posted by jorgelj  · 31-10-2013 - 09:45

Hola Vicente,



Por favor prueba la biblioteca de manera independiente, sin CakePHP. Por ejemplo abre la línea de comandos y ejecuta el ejemplo easy/EmbedSimpleHTML.php:



$ php EmbedSimpleHTML.php



El documento generado debe ser correcto.



Saludos.


Posted by vicente  · 04-11-2013 - 18:39

ya lo hice sin cake y aun asi me muestra un error al abrir el archivo


Posted by vicente  · 04-11-2013 - 18:50

Hola, ya lo resolví, puede quedar como ayuda a quien tenga un problema similar, de esta manera no funciona



$doc.= '<table width="500" border="0" cellspacing="0" cellpadding="0"><tr> <td></td> <td></td>    </tr>  </table>  ';



pero así funciona a la perfeccion: 



$doc.= '<table border="1">';

$doc.= '<tbody><tr><td style="background-color: yellow">1_1</td><td rowspan="3" colspan="2">1_2</td></tr>';

$doc.='<tr><td>Some random text.</td></tr>';

$doc.='<tr><td><ul><li>One</li><li>Two <b>and a half</b></li></ul></td></tr>';

$doc.='<tr><td>3_2</td><td>3_3</td><td>3_3</td></tr></tbody>';

$doc.= '</table>';