lundi 16 mai 2022

Dompdf Laravel return certain table in view as black block

I am using barryvdh/laravel-dompdf version 0.8.4 in Laravel 5 to create a PDF from a view.
Before i do composer update, the pdf working just fine, but now its showing up like this enter image description here
It was supposed to be like this enter image description here

This is the view for the black part

    <table class="header" style="table-layout:fixed;width:100%;background-color:none;border-collapse: collapse;">
            <thead>
                <tr width="100%"><th>
                    <div style="font-weight:200;font-size:16px;margin-top:10px;text-align: center;">
                        <br>
                        <b>COACHING REPORT</b><br>
                        <b>SEMESTER 
                        @if(date('m', strtotime($detail->date)) > 6) 1 @else 2 @endif   
                        - TAHUN PELAJARAN </b>
                    </div>
                    <div style="width: 100%;font-size:11px!important;margin-top:10px">
                        <table style="width: 100%;text-align:left;">
                            <tr style="background: none;">
                                <td style="width: 15%;">Nama Coach</td>
                                <td>:</td>
                                <td style="width: 85%;"></td>
                            </tr>
                            <tr style="background: none;">
                                <td>Nama Coachee</td>
                                <td>:</td>
                                <td></td>
                            </tr>
                            <tr style="background: none">
                                <td>Kelas</td>
                                <td>:</td>
                                <td> </td>
                            </tr>
                            <tr style="background: none;">
                                <td>Periode</td>
                                <td>:</td>
                                <td> -  </td>
                            </tr>  
                        </table>
                    </div>
                </th></tr>
            </thead>
        </table>

This is the view for the bottom part that works just fine

    <table class="tableBorder" width="100%"
            style="margin-top: 10px; clear: both; top: 80px;border-collapse: collapse;">
            <thead>
                <tr class="tableBorder">
                    <th
                        style="font-size: 11px; margin:  5px !important; font-weight: 120;width:7%;">
                        <b>AREA / RANAH PERKEMBANGAN</b></th>
                    <th
                        style="font-size: 11px; margin:  5px !important; font-weight: 120;width:10%;">
                        <b>DESKRIPSI</b></th>
                </tr>
            </thead>
            <tbody class="bordered" style="">
                <tr class="tableBorder">
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        Perkembangan akademik</td>
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        {!! $isi[0] !!}
                    </td>
                </tr>
                <tr class="tableBorder">
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        Perkembangan sikap sosial</td>
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        {!! $isi[1] !!}
                    </td>
                </tr>
                <tr class="tableBorder">
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        Perkembangan karakter</td>
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        {!! $isi[2] !!}
                    </td>
                </tr>
                <tr class="tableBorder">
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        Perkembangan ketrampilan/minat/bakat/talenta</td>
                    <td
                        style="font-size: 11px; margin: 5px !important; font-weight: 60;">
                        {!! $isi[3] !!}
                    </td>
                </tr>
            </tbody>
        </table>

I try to comment the table,thead,tr,and th part, and leaving just the div and its finally showing up, but I have a lot of view that use this, so i was wondering if i can just fix this from the dompdf part without changing the view.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire