1

I have an HTML with a table with style="width:100%;' however when I create the PDF the table is not the size of the document page (A4) but just fits the content of the table which gets a little messy this way.

What am I doing wrong?

$html2pdf = new HTML2PDF('P','A4','en', false, 'ISO-8859-15');
$html2pdf->setDefaultFont('Arial');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($PDFsmarty->fetch('pdf.tpl'));
$content_PDF = $html2pdf->Output('', 'S');


pdf.tpl
<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>........

2

you have to specify the width of all the elements table, th, td, div
Ancien pseudo : lolo

3

Am I able to use:

<table style="width:100%;">
<tr>
<td style="width:30%;"></td>
<td style="width:40%;"></td>
<td style="width:30%;"></td>
</tr>
</table>

Or should it be real sizes in stead of respective?

4

% will works (like in examples...)
Ancien pseudo : lolo