<table id="example" class="display nowrap" style="width:100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Tiger Nixon</td>
                <td>System Architect</td>
                <td>Edinburgh</td>
                <td>61</td>
                <td>2011/04/25</td>
                <td>$320,800</td>
            </tr>
            <tr>
                <td>Garrett Winters</td>
                <td>Accountant</td>
                <td>Tokyo</td>
                <td>63</td>
                <td>2011/07/25</td>
                <td>$170,750</td>
            </tr>
            
       
        </tbody>
        <tfoot>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </tfoot>
    </table>





<button class="btn btn-secondary mb-3" onclick="printPageArea('myTable');">Print</button>
<table class="table table-sm " id="myTable">
    <tbody  class="border">
        <tr>
            <td>
                <div class="row">
                    <!-- <div class="col-md-8"><h1><?= ENTREPRISE_NAME ?></h1></div> -->
                    <div class="col-md-3"><img src="<?=ASSET."img/logo-mecreco-2.PNG" ?>" class="pull-left"></div>
                </div>

            </td>
        </tr>
        <tr>
            <td>
                <?php
                   

                    if ($resultat) {
                        $entete = current($resultat);
                ?>
                <table class="mb-5" style="width: 100%;">
                    <tbody>
                        <tr class="mb-3 border-bottom-1">
                            <td><h4 class="font-weight-bold"><?= strtoupper($nom_rapport) ?></h4></td>
                            <td class="text-right"><?= convertDateToFrench(date("Y-m-d")) ?></td>
                        </tr>

                        <tr>
                            <td>
                                <div class="row mt-3">
                                    <div class="col-md-12 mb-3"><strong>Working Date</strong>: <?= convertDateToFrench( $date_debut) ?></div>
                                    <div class="col-md-12 mb-3"><strong>Branch Code</strong>: <?= $entete->CodeAgence ?></div>
                                    <div class="col-md-12 mb-3"><strong>Branch Name:</strong> <?= $entete->DescriptionAgence ?></div>
                                </div>
                            </td>
                            <td>
                                <div class="row mt-3">
                                    <div class="col-md-12 mb-3 text-right"><strong>A/c No.</strong>: <?= $Compte_Gl ?></div>
                                    <div class="col-md-12 mb-3 text-right"><strong>A/c Title</strong>: <?= $entete->NomCompte ?></div>
                                    <div class="col-md-12 mb-3 text-right"><strong>Currency ID</strong>: <?= $entete->CodeDevise_desi ?></div>
                                    
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <hr>        
                <table border="1" class="table table-bordered table-sm table-striped table-hover mt-3" style="width:100%">
                    <thead class="bg-dark text-white">
                        <tr class="font-weight-bold">
                            <th>Tran Date</th>
                            <th >Tran Reference</th>
                            <th>TranDescription</th>
                            <th>A/c Title</th>
                            <th>Compte</th>
                            <th>Dr Amt</th>
                            <th>Cr Amt</th>
                            <th>Created By</th>
                        </tr>
                    </thead>
                    <tbody>

                    </tbody>
                    <tfoot>
                    </tfoot>
                </table>
                <hr>
                <table class="mt-2" style="width: 100%;">
                    <tbody>
                        <tr>
                            <td colspan="3">Checked By</td>
                            <td>..................................</td>
                            <td>Confirmed By</td>
                            <td colspan="3">..................................</td>
                        </tr>
                        <tr>
                            <td colspan="3">Sign Date</td>
                            <td>..................................</td>
                            <td>Sign Date</td>
                            <td colspan="3">..................................</td>
                        </tr>
                    </tbody>
                </table>
                <?php 
                    }else{
                        echo "Aucune donnée disponnible";
                    }
                 ?>
            </td>
        </tr>
    </tbody>

</table>


<script type="text/javascript">
    function printPageArea(areaID){
    var printContent = document.getElementById(areaID);
    var WinPrint = window.open('', '', 'width=900,height=650');
    WinPrint.document.write(printContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    // WinPrint.close();
}
</script>