Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

duckz1209's avatar

table overlapping

why did my tables overlap when array from foreach reach to 2nd page? im using dompdf here's my code

                <table style="border: 0; ">
                    <tr>
                        <th style="font-family: 'Times New Roman'">Names of borrowers</th>
                    </tr>
                    <tr>
                        <th style="font-family: 'Times New Roman'">Date:<?php echo  date("j F, Y"); ?</th>
                    </tr>
                </table>
            </div>

<div>
    <table border="1" width="100%">
        <thead>
            <tr>
                    <th>ID</th>
                    <th>Name</th>
            </tr>
        </thead>

        <tbody >
            @foreach($borrowers as $borrower)
            <tr>
                    <td>{{$borrower->id }}</td>
                    <td>{{$borrower->lastname}}, {{$borrower->firstname}} {{$borrower->middlename}}</td>
            </tr>
            @endforeach 
        </tbody>
    </table>
     </div>
0 likes
2 replies
duckz1209's avatar

when the collection of borrowers reached second page, the display on 1st page suddenly fullpage which overlap the 1st table

mvd's avatar

You missed a > in the php closing tag.

Date:<?php echo  date("j F, Y"); ?</th>
Date:<?php echo  date("j F, Y"); ?></th>

Please or to participate in this conversation.