1

Stuck on this little issue where the table headers are overlapping the tbody rows as below; image overlapping issue on PDF

This is the generalized code that creates the table;

<table id="symptoms" class="table table-bordered  mg-t-15" style="table-layout: fixed;">
                    <thead>
                        <tr class='bg-gray-300 tx-12 tx-uppercase tx-color-02'>
                            <th>Symptom</th>
                            <th>Status</th>
                            <th>Rating</th>
                            <th>Frequency/Details</th>
                        </tr>
                    </thead>
                    <tbody class='tx-12 mg-t-10'>
                            <?php foreach ($this->patient->medical->symptoms as $symptom): ?>
                                <tr class='tx-12'>
                                    <td>....</td>
                                    <td>....</td>
                                    <td>....</td>
                                    <td>....</td>
                                </tr>
                            <?php endforeach; ?>
                    </tbody>
                </table>

I have tried a range of suggestions from SO that all haven't worked so I'm at a bit of a loose end here haha!

Darren
  • 13,050
  • 4
  • 41
  • 79
  • Hi @Darren, were you able to find a solution to this? Stuck on similar problem – Nikhil Singh Jun 23 '21 at 11:25
  • 1
    Hi @NikhilSingh - unfortunately didn't end up with a solution to have the table header remain on the next page, instead had it removed if it went over the second page with the following css; `table#symptoms {page-break-inside: auto}table#symptoms tbody tr td {padding: 5px 8px;}table#symptoms { page-break-inside:auto } table#symptoms tr { page-break-inside:avoid; page-break-after:auto } table#symptoms thead { display:table-row-group }` which ended up [**looking like this**](https://i.imgur.com/iv0PYZ3.png).. – Darren Jun 24 '21 at 00:49
  • 1
    Thanks a lot for replying and for sharing your solution :) – Nikhil Singh Jun 24 '21 at 04:27
  • 1
    @NikhilSingh Not a problem at all - hope it helps! – Darren Jun 24 '21 at 05:07

0 Answers0