Forum


Replies: 8   Views: 5008
Error css
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 nikkyb8  · 26-11-2013 - 11:07

Hi,



 



<?php

    session_start();



include ('class/connect.php');

require_once ('class/connect.class.php');



require_once 'docx/classes/CreateDocx.inc';



$docx = new CreateDocx();

$contenu = "<style>";

$contenu .= file_get_contents ('css/tinymce.css');



 // .table1 tr td { border:3px solid black; } .table1 { border-collapse:collapse; color:#6B506B; border:1px solid #2E638E; } </style> ";

$contenu .= " </style> ";



$customLayout = array(

                    'width' => '11906',

                    'height' => '16838',

                    'numberCols' => '1',

                    'orient' => 'portrait',

                    'code' => '9',

                    'marginTop' => '1017',

                    'marginRight' => '1001',

                    'marginBottom' => '1417',

                    'marginLeft' => '1001',

                    'marginHeader' => '308',

                    'marginFooter' => '708',

                    'gutter' => '0'      

                );

$docx->modifyPageLayout('custom', $customLayout);





    $contenu .= '<table style=\"height: 21px;\" width=\"384\"><tbody><tr><td style=\"color: white; text-align: center; background-color: black;\">test fond</td><td></td><td></td></tr></tbody></table><table class=" table1" style="height: 21px;" width="197"><thead><tr><td>entete</td></tr></thead><tbody><tr><td>fond 2</td></tr></tbody></table>';

    $contenu = htmlspecialchars_decode($contenu);

    $docx->embedHTML($contenu);



$docx->createDocxAndDownload('/tmp/'.$_SESSION["pseudo"].'_'.$_SESSION["utilisateur_id"].'/'.time().'ee');//we send the resulting document to the browser





.CSS :



.table1 td { border:1px solid #ABABAB; } .table1 { border-collapse:collapse; background-color:white; } .table1 tr{ height:25px; } .table1 thead td{ background-color:#EEEEEE; }



.Withthis:table1theadtd{background-color: #EEEEEE;}

the cellshouldbe coloredand notpart of the text...



Thank's