문제

Is it possible to make nested table fit height of its parent cell in TCPDF?

My code:

<?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');
?>

I want table in last cell to fill it entirely. Is there any way to do this?

도움이 되었습니까?

해결책

Well, it seems the only way is not to use WriteHTML, but to write table as sequence of cells.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top