如何在dompdf中使用CSS并排显示2个表

问题描述 投票:0回答:1

我尝试使用display inline-block,但dompdf不支持inline显示。我在这里:enter image description here

使用这些代码:

    <div style="float: left; width: 50%;">
<table style="" border="1px solid" class="mr-3">
            <body>
                <tr>
                    <td class="pl-1">Account No</td>
                    <td class="center">:</td>
                    <td class="pl-1"><?=$client->acc_number?></td>
                </tr>
                <tr>
                    <td class="pl-1">Full Name</td>
                    <td class="center">:</td>
                    <td class="pl-1"><?=$client->fullname?></td>
                </tr>
                <tr>
                    <td class="pl-1">Contact No</td>
                    <td class="center">:</td>
                    <td class="pl-1"><?=$client->contact_num?></td>
                </tr>
                <tr>
                    <td class="pl-1">Address</td>
                    <td class="center">:</td>
                    <td class="pl-1"><?=$client->address?></td>
                </tr>
                <tr>
                    <td class="pl-1">Status</td>
                    <td class="center">:</td>
                    <td class="pl-1"><?=$client->remarks?></td>
                </tr>
            </body>
        </table>
    </div>
    <div style="float: right; width: 50%;">
<table style="" border="1px solid" class="inlineTable">
            <tbody>
                <tr>
                    <td>Date of Loan</td>
                    <td>:</td>
                    <td class="right"><?=strftime("%b. %d, %Y",strtotime($loan->date_loan))?></td>
                </tr>
                <tr>
                    <td>Term of Loan</td>
                    <td>:</td>
                    <td class="right"><?= $loan->loan_term;?> <?=$loan->loan_term == 1 ? " Month" : " Months"; ?></td>
                </tr>
                <tr>
                    <td>End of Loan</td>
                    <td>:</td>
                    <td class="right"><?= strftime("%b. %d, %Y",strtotime($loan->loan_end))?></td>
                </tr>
                <tr>
                    <td>Collection</td>
                    <td>:</td>
                    <td class="right"><?=$loan->collection?></td>
                </tr>
                <tr>
                    <td>Principal</td>
                    <td>:</td>
                    <td class="right"><?=number_format($loan->principal)?></td>
                </tr>
                <tr>
                    <td>Interest</td>
                    <td>:</td>
                    <td class="right"><?=$loan->interest?>%</td>
                </tr>
                <tr>
                    <td>Total Interest</td>
                    <td>:</td>
                    <td class="right"><?=number_format($loan->total_interest)?></td>
                </tr>
                <tr>
                    <td>Total Payment</td>
                    <td>:</td>
                    <td class="right"><?=number_format($loan->total)?></td>
                </tr>
                <tr>
                    <td>Amount of Payment</td>
                    <td>:</td>
                    <td class="right"><?=number_format($loan->payment)?></td>
                </tr>
                <tr>
                    <td>Total Paid</td>
                    <td>:</td>
                    <td class="right"><?=number_format($total_paid)?></td>
                </tr>
                <tr>
                    <td>Balace</td>
                    <td>:</td>
                    <td class="right"><?=number_format($balance)?></td>
                </tr>
            </tbody>
        </table>
    </div>

表格的边框不在浮动div的右边。我搜索了很多dompdf表问题,但仍然找不到任何答案,请帮助我。

表格的边框不在浮动div的右边。我搜索了很多dompdf表问题,但仍然找不到任何答案,请帮助我。

表格的边框不在浮动div的右边。我搜索了很多dompdf表问题,但仍然找不到任何答案,请帮助我。

表格的边框不在浮动div的右边。我搜索了很多dompdf表问题,但仍然找不到任何答案,请帮助我。

表格的边框不在浮动div的右边。我搜索了很多dompdf表问题,但仍然找不到任何答案,请帮助我。

html css dompdf
1个回答
0
投票
remove the div you use and add another table
<table>
<tr>
  <td> your left side table </td>
  <td> your right side table </td>
</tr>
</table>
© www.soinside.com 2019 - 2024. All rights reserved.