Forum


Replies: 4   Views: 4523
Designation / table
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  · 15-11-2013 - 09:28

Hello,

I have a tablethat Ifilledthis way:

$aData[]= array ('designation' => $donneesss,'qty' =>$ data["Quantity"],pu '=>$ data["prix_unitaire"].' € ',' ht'=>$ data["ht"] '.');



In$donneesssIeg



Mr.marcmartin

15 to 21

Foroneperson



ThenI insert itwith this:



$docx->addTemplateVariable($aData,'table', array ('header'=> false));



Can you tell mehow to findthe textin the same way(withline break)?



Thank youin advance


Posted by jorgelj  · 19-11-2013 - 09:09

Hello,



We recommend you to use replaceTemplateVariableByHTML to replace text.



But we don't understand this sentence:



----------------------------



Can you tell me how to find the text in the same way (with line break)?



----------------------------



Could you explain it further?



Regards.


Posted by nikkyb8  · 19-11-2013 - 10:19

Hello,



Imeanlike this:

Mr.marcmartin

15to 21

Forone person

-------------------------------------

Not like this

Mr.marcmartin15to 21Forone person

---------------------------------------



In factI have amodelwith a table thatcontains aheaderand a linewith:

designationand$$$$qty



Indesignation,there may beline breaks.

Inséertotheline in mytable, I use:

$aData[]= array ('designation' => $sss,'qty' =>$ data["Quantity"]);



The problem is thattheline breaksdo not appearand I donot want tocreatehtml tablebecause the usercouldnot change thecolorof the headeretc ...



Regards


Posted by jorgelj  · 19-11-2013 - 20:15

Hello,



You'll need to use the replaceTemplateVariableByHTML method. Using this method add adding styles you can set colors.



Regards.