TCPDF并排表 [英] TCPDF Side by Side Table

查看:326
本文介绍了TCPDF并排表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using TCPDF to print some document record. But my second table will always next to the bottom of the first table (just like the image). I need to make the second is on the left side of the first table. Any code warrior please ... :)

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

Here's my code so far ...

推荐答案

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

If you want to have a table side-by-side, you have to create a parent table where the width is 100% and the one pair of "tr" and 2 pairs of "td" and, on each of "td" make another table. Here is the draft:

<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。

It seems your using writeHTML per group, why not just use one and apply the parent table with two child table, you just have to use concat.

这篇关于TCPDF并排表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆