php - TCPDF displays only one HTML table from the loop -


I successfully display the HMTL table in PDF file using TCPDF.

The only problem is that it should display several tables because I use the FOREACH loop but it only displays a table.

Please check your code below and help me find my mistake:

   SetFontSubsetting (wrong); $ Obj_pdf- & gt; AddPage (); Ob_start (); Forex currency ($ result as $ line) {$ first = $ row-> first; $ Sec = $ line- & gt; second; $ Third = $ row-> Third; $ Tbl = & lt; & Lt; & Lt; EOD & lt; Table cells = "0" cellpadding = "1" border = "1" & gt; & Lt; TR & gt; & Lt; TD & gt; $ First & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> $ Sec & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; $ 3rd & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; The end of the day; } Ob_end_clean (); $ Obj_pdf- & gt; Write html ($ tbl, true, false, true, false, ''); $ Obj_pdf- & gt; Output ('output.pdf', 'I'); ? & Gt;  

In each loop, with the new value you $ tbl You must include the following:

  $ tbl. = // the rest of the code by using  

. You can add strings in PHP


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -