-1

If I use border-collapse: collapse; for the table in my PDF, the bottom border of my table head is missing.

Table head

My code:

<style>
    table {
        border-collapse: collapse;
        table-layout: fixed;
        width: 100%;
        overflow-wrap: anywhere;
    }

    table th {
        border: 2px solid #000;
        text-align: center;
        padding: 4px;
    }

    table td {
        border: 2px solid #000;
        text-align: center;
        padding: 4px;
    }

    .page_break {
        page-break-before: always;
    }
</style>


<table>
    <thead>
    <tr>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
    </tr>
    </thead>

....

How can I fix that error?

Luu
  • 1
  • 2

1 Answers1

0

lol bro you need to close the table.

<style>
    table {
        border-collapse: collapse;
        table-layout: fixed;
        width: 100%;
        overflow-wrap: anywhere;
    }

    table th {
        border: 2px solid #000;
        text-align: center;
        padding: 4px;
    }

    table td {
        border: 2px solid #000;
        text-align: center;
        padding: 4px;
    }

    .page_break {
        page-break-before: always;
    }
</style>


<table>
    <thead>
    <tr>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
        <th>Test</th>
    </tr>
    </thead>
</table>

enter image description here

  • I closed the table below. The problem occurs as long as there is no data in the tbody yet. – Luu Jun 27 '22 at 18:22