2010-04-14 98 views
0

是否可以在TCPDF中使其父級單元格的嵌套表適合高度?TCPDF中的嵌套表高度

我的代碼:

<?php 
require_once('tcpdf/config/lang/eng.php'); 
require_once('tcpdf/tcpdf.php'); 

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); 

$pdf->setPrintHeader(false); 
$pdf->setPrintFooter(false); 

$pdf->SetFont('times', 'BI', 8); 

$pdf->AddPage(); 

$pdf->writeHTML('<table> 
    <tr><td bgcolor="gray"> Angoisse et vif espoir, sans humeur factieuse.<br/> 
Plus allait se vidant le fatal sablier,<br/> 
Plus ma torture était âpre et délicieuse;<br/> 
Tout mon coeur s’arrachait au monde familier</td> 
    <td bgcolor="lightgray">Second</td> 
    <td bgcolor="gray">Third</td> 
    <td> 
     <table style="height: 100%"> 
      <tr bgcolor="blue" style="height: 30%"><td bgcolor="yellow" style="height: 30%">Ichi</td></tr> 
      <tr bgcolor="white" style="height: 30%"><td bgcolor="cyan" style="height: 30%">Ni</td></tr> 
      <tr bgcolor="blue" style="height: 30%"><td bgcolor="yellow" style="height: 30%">San</td></tr> 
     </table> 
    </td></tr> 
</table>'); 

$pdf->Output('example_002.pdf', 'I'); 
?> 

我想表中最後一個單元格完全填充它。有沒有辦法做到這一點?

回答

0

那麼,看來唯一的方法是不要使用WriteHTML,而是要把表格寫成單元格的序列。

+0

使用單元格解決它。 – 2010-04-28 12:47:43

+0

您使用哪種方法編寫單元格?我有一個headeacke自己與:( – decebal 2012-06-27 07:30:59