I'm working in a web page developed using Yii Extension and I'm using the HTML2PDF extension to generate PDFs (http://html2pdf.fr/). Though the PDF is generated fine, it doesn't seem to recognize my tables' sizes; doesn't matter the width or height I specify for a row or a whole table: the PDF is always generated the same way (with a table width that just fits the cell content)... Here is how I'm trying to specify the width:
<table width="500px" height="20px" style="margin:10px;">
<tr>
<td width="25%"></td>
<td width="50%"></td>
<td width="25%"></td>
</tr>
<tr bgcolor="#EAF8FF">
<td colspan="3">
<strong>Title</strong>
</td>
</tr>
I've tried specifying the width with:
... etc. but nothing seems to matter... The table size and width is always proportional to the text it contains. However, both the "bgcolor" in the 'tr' tag and the "colspan" in the 'td' tag work fine, so I don't know what can be happening... I've also tried specifying the size inside the 'tr', but nothing... Any idea on what can I be missing?
Have you tried with "style" attribute? All examples on html2pdf wiki is with this attribute : http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:bookmark&s[]=td&s[]=width
You can also use "col" tags after the opening "table" tag. e.g.
<col width="250">
<col width="500">
<col width="250">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With