IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

html2pdf ne reconnait pas display: inligne-block


Sujet :

PHP & Base de données

  1. #1
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2020
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Août 2020
    Messages : 16
    Points : 19
    Points
    19
    Par défaut html2pdf ne reconnait pas display: inligne-block
    bonjour, je veux generer un pdf avec des petits tableaux l'un a coté de l'autre tout fonctionne mais quand je genere le pdf il n'aligne pas les tableaux
    Merci d'avance
    voilà mon code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    <?php ob_start(); ?>
    <?php require_once '../helpers' . DIRECTORY_SEPARATOR . 'requires.php'; ?>
    <link rel="icon" href="https://www.didaetoileservice.ma/wp-content/uploads/2020/01/LogoDidaSite.png" />
     
     
    <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900" rel="stylesheet">
     
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style2.css" media="screen">
    <link media="print" href="../css/print.css"  type="text/css" rel="stylesheet" />
    <body>
        <style>   
            .tableaux{
                display:inline-block !important;
                vertical-align:top !important;
            }</style>
    <?php
    require_once '../helpers' . DIRECTORY_SEPARATOR . 'requires.php';
     
    $id_ja = $_GET['id'];
    $query = "select j_a.type_ja,site.nom_site from detail_ja INNER join j_a on detail_ja.id_ja=j_a.id_ja  INNER join site on detail_ja.id_site=site.id_site where detail_ja.id_ja='$id_ja' ";
    $rslt = mysqli_query($conn, $query);
    if ($rslt) {
        $row = mysqli_fetch_array($rslt);
        $site = $row['nom_site'];
        $type_ja = $row['type_ja'];
    }
    ?><div><br><table border='1'  style="text-align: center; border: 1px solid #000000; border-collapse: collapse; ">
                <tbody>
                    <tr >
                        <td style="width: 30%; height: 1px; border: 2px solid #000000; " colspan="1" rowspan="4" nowrap="nowrap"><img src="../img/fr.png"></td>
                        <td style="width: 30%; height: 1px; border: 2px solid #000000; " colspan="1" rowspan="2" nowrap="nowrap">Enregistrement</td>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap">EN-S03-03</td>
                    </tr>
                    <tr>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap">Version: 01</td>
                    </tr>
                    <tr>
                        <td style="width: 30%; height: 1px; border: 2px solid #000000;" colspan="1" rowspan="2" >Journée Alimentaire <b><?php echo $type_ja; ?></b></td>
                        <td style="width: 30%; border: 2px solid #000000; " colspan="2" rowspan="1" nowrap="nowrap" >Date d'application : 01/10/2019</td>
                    </tr>
    </tbody>
            </table>
        </div>
        <div>
            <br><br><br>
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Le : <?php echo date('d/m/Y'); ?></label>
            <br><br>
            <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Site : <?php echo $site; ?></label>
        </div>
        <h2 style="text-align: center"><u>Détails De L'Entrée</u></h2>
    <?php
    $id = $_GET['id'];
    $date = $_GET['date'];
    $site = $_SESSION['id_site'];
    $query1 = "select produits.Id_produit,designation,det_quantite,unite,prix from detail_srt join produits on produits.Id_produit=detail_srt.Id_produit where id_site='$site' and date='$date' ";
     
    $rslt1 = mysqli_query($conn, $query1);
    $tot1 = 0;
    ?><input  name="datee" value="<?php print $date ?>"  hidden="" >
    <h3><u>Sorties</u></h3>
        <table border='1' id='customers'>
            <thead class='thead-dark'><tr><th>reference</th><th>designation</th><th>Quantité</th><th>unite</th><th>prix</th><th>VAleur</th></tr></thead>
    <?php
    while ($row1 = mysqli_fetch_array($rslt1)):
        $sum1 = $row1['det_quantite'] * $row1['prix'];
     
        $tot1 = $tot1 + $sum1;
        ?><tr><td><?php print $row1['Id_produit']; ?></td>
                    <td><?php print $row1['designation']; ?></td>
                    <td><?php print $row1['det_quantite']; ?></td>
                    <td><?php print $row1['unite']; ?></td>
                    <td><?php print $row1['prix']; ?></td>
    <td> <?php print $sum1; ?></td></tr>
    <?php endwhile; ?>      
            <tr><td>Total</td><td></td><td></td><td></td><td></td><td><?php print $tot1; ?></td></tr></table> 
    <br><h3><u>Entrées</u></h3>
     
    <?php
    $query = "select produits.Id_produit,designation,det_quantite,unite,prix,dlc,nom_frs from detail_ent join fournisseurs on detail_ent.id_frs=fournisseurs.id_frs join produits on produits.Id_produit=detail_ent.Id_produit  where id_site='$site' and date='$date' ";
     
    $rslt = mysqli_query($conn, $query);
    $row = mysqli_num_rows($rslt);
    if ($row > 0) {
        $tot = 0;
        ?>
    <table border='1' id='customers'>
                <thead class='thead-dark'><tr><th>reference</th><th>designation</th><th>Quantité</th><th>unite</th><th>prix</th><th>DLC</th><th>Fournisseur</th><th>VAleur</th></tr></thead>
    <?php
        while ($row = mysqli_fetch_array($rslt)):
            $sum = $row['det_quantite'] * $row['prix'];
     
            $tot = $tot + $sum;
            ?><tr>
                        <td><?php print $row['Id_produit']; ?></td>
                        <td><?php print $row['designation']; ?></td>
                        <td><?php print $row['det_quantite']; ?></td>
                        <td><?php print $row['unite']; ?></td>
                        <td><?php print $row['prix']; ?></td>
                        <td><?php print $row['dlc']; ?></td>
                        <td> <?php print $row['nom_frs']; ?></td>
                        <td> <?php print $sum; ?></td></tr>
                    <?php endwhile; ?>      
                <tr><td>Total</td><td></td><td></td><td></td><td></td><td></td><td></td><td><?php print $tot; ?></td></tr></table> 
            <br><h3><u>Journée Alimentaire: Sortie</u></h3>
            <?php
            $tot = 0;
        }
        ?>
        <?php
        $type_site = $_SESSION['type_site'];
     
        $quer = "select clients.id_client,type_client,prix_repas from clients join prix_marche on prix_marche.id_pm=clients.id_pm where etab='$type_site'";
        $rsl = mysqli_query($conn, $quer);
        $tot3 = 0;
        ?>
        <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
                <thead class='thead-dark'><tr><th></th><th>Repas</th></tr></thead>
     
                <?php
                $totati = 0;
                $toti = 0;
                while ($rowi = mysqli_fetch_array($rsl)):
                    ?>       
     
        <?php $quer0 = "select id_repas,name from repas";
        $rs = mysqli_query($conn, $quer0);
        ?> <tr><td colspan="1" rowspan="4" style=" text-transform: uppercase"><?php print $rowi['type_client'] ?></td></tr>
     
        <?php while ($rowo = mysqli_fetch_array($rs)):
            ?><tr><td ><?php print $rowo['name'] ?></td>
    </tr>
    <?php endwhile; ?> 
    <?php endwhile; ?> 
    </table> </div>
        <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
                <thead class='thead-dark'><tr><th>effectifs</th></tr></thead>
                <?php
                $queryy = "select id_client,effectif,total_ja,total from detail_ja join j_a on detail_ja.id_ja=j_a.id_ja where detail_ja.id_ja='$id' ";
                $rslti = mysqli_query($conn, $queryy);
                while ($rowu = mysqli_fetch_array($rslti)):
                    ?> 
                    <tr>
                        <td ><?php print $rowu['effectif'] ?></td>
    </tr>
    <?php endwhile; ?></table></div>
    <div class="tableaux"> <br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;
                                              margin-right:auto !important;">
            <thead class='thead-dark'><tr><th>Total</th></tr></thead>
                <?php
                $queryy = "select total from detail_ja  where detail_ja.id_ja='$id' group by total ";
                $rslti = mysqli_query($conn, $queryy);
                while ($rowu = mysqli_fetch_array($rslti)):
                    ?> 
                    <tr>
                        <td height="101px"><?php print $rowu['total'] ?></td>
     </tr><?php endwhile; ?></table></div>
        <div class="tableaux"><br><br><table border='1' id='customers' style="width: 50% !important;  margin-left:auto !important;margin-right:auto !important;">
                <thead class='thead-dark'><tr><th>Total</th></tr></thead>
                            <?php
                            $queryy = "select total_ja from j_a   where id_ja='$id' ";
                            $rslti = mysqli_query($conn, $queryy);
                            while ($rowu = mysqli_fetch_array($rslti)):
                                ?> 
                    <tr>
                        <td height="202px"><?php print $rowu['total_ja'] ?></td>
                    </tr>
    <?php endwhile;?></table></div></body>
        <?phpob_flush(); ?>
    <?php use Spipu\Html2Pdf\Html2Pdf;
     
     
     
     
        require_once(dirname(__FILE__) . '/../pdf/vendor/autoload.php');
     
     
     
        $content = ob_get_clean();
     
     
        $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8');
        $html2pdf->setDefaultFont('Helvetica');
        $html2pdf->pdf->SetDisplayMode('fullpage');
        $html2pdf->WriteHTML($content);
     
        $html2pdf->Output(__DIR__ . "/cmd_pdf/cmd_$id_ja.pdf", 'I');
    ?>

  2. #2
    Membre confirmé
    Homme Profil pro
    Déveleoppeur Web/Mobile
    Inscrit en
    Avril 2013
    Messages
    330
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Déveleoppeur Web/Mobile
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2013
    Messages : 330
    Points : 545
    Points
    545
    Par défaut
    Bonjour,

    As-tu testé ton code directement en html pour vérifier que le rendu était celui attendu ?
    Si c'est le cas, pensez à vérifier dans la documentation de la librairie html2pdf s'il n'y a pas de contre-indications sur certaines propriétés css, et c'est souvent le cas.
    Il faudra peut-être contourner le problème sans utiliser la propriété display:inline-block, et la il faut jouer avec les éléments html. Tu peux par exemple faire des tableaux imbriqués afin d'aligner tes éléments.

Discussions similaires

  1. ma page ne reconnait pas la classe dans le css
    Par Dnx dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 25/08/2005, 23h57
  2. [Debutant(e)]StreamTokenizer: ne reconnait pas les floats!!
    Par doudine dans le forum Entrée/Sortie
    Réponses: 8
    Dernier message: 10/12/2004, 17h28
  3. [HARDWARE] Graveur DVD ne reconnait pas des DVD
    Par Yepazix dans le forum Périphériques
    Réponses: 2
    Dernier message: 30/11/2004, 15h22
  4. Installation : ne reconnait pas le CDROM
    Par SebCBien dans le forum Matériel
    Réponses: 4
    Dernier message: 08/08/2004, 17h10
  5. Réponses: 4
    Dernier message: 24/03/2004, 12h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo