TCPDF并排表

问题描述 投票:-2回答:1

我正在使用TCPDF打印一些文档记录。但我的第二个表总是在第一个表的底部(就像图像一样)。我需要让第二个位于第一个表的左侧。任何代码战士请... :)

enter image description here

这是我到目前为止的代码......

enter image description here

php html-table inline tcpdf
1个回答
1
投票

如果你想要一个并排的表,你必须创建一个宽度为100%的父表和一对“tr”和2对“td”,并在每个“td”上创建另一张桌子。这是草案:

<table width="100%" cellpadding="0" border="0">
    <tr>
        // Left side Table
        <td width="50%">
            <table width="100%" border="1">
                <tr><td>Data goes here</td></tr>
            </table>    
        </td>

        // Right side Table
        <td width="50%">
            <table width="100%" border="1">
                <tr><td>Data goes here</td></tr>
            </table>   
        </td>
    </tr>
</table>

看来你每组使用writeHTML,为什么不只使用一个并将父表应用于两个子表,你只需要使用concat。

© www.soinside.com 2019 - 2024. All rights reserved.