tommy2shoes Posted April 5, 2011 Share Posted April 5, 2011 I am trying to get a table using tcpdf which will act as an invoice. Whatever I seem to change the column widths seem to stay the same and look equally divided across the table. I'm sure the fix is simple but I've no idea what it is. Any ideas? Part of the code is: $apname <br> $address<br><br> Your ref: $matter<br> Your vat number: $vat<br><br><br> <table width='800' border='0'> <tr> <td width='232'>PRODUCT/SERVICE</td> <td width='400'>DESCRIPTION</td> <td width='75'>UNIT PRICE (£)</td> <td width='75'>LINE TOTAL (£)</td> </tr> <tr> <td>Process Agent Appointment</td> <td>Letter of Confirmation $idcode</td> <td width='75'>500 (£)</td> <td width='75'>500 (£)</td> </tr> </table> "; // output the HTML content $pdf->writeHTML($htmlcontent, true, false, false, false, ''); Link to comment https://forums.phpfreaks.com/topic/232729-tcpdf-and-table-cell-widths/ Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 I don't see anything wrong, but I'd try: 1. Removing the width= for the table. 2. Changing all the single quotes to double quotes around the attributes. Link to comment https://forums.phpfreaks.com/topic/232729-tcpdf-and-table-cell-widths/#findComment-1197062 Share on other sites More sharing options...
tommy2shoes Posted April 5, 2011 Author Share Posted April 5, 2011 Thank you. I can't see anything wrong either. I've tried removing the width and that makes no difference. If I change the ' to " I get an error - Parse error: syntax error, unexpected T_LNUMBER. (Am using Dreamweaver for this) Hence I'm a bit stuck. Thanks anyway. Link to comment https://forums.phpfreaks.com/topic/232729-tcpdf-and-table-cell-widths/#findComment-1197102 Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 You're getting the error because your string is delimitted using double quotes, so you'd have to escape them all which is a major pita. You can get around this (while still preserving interpolation inside the string, by using a heredoc. $somevar = //... all your markup including variables, and double quotes is fine HERE; Link to comment https://forums.phpfreaks.com/topic/232729-tcpdf-and-table-cell-widths/#findComment-1197109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.