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

HTML Discussion :

Fixer la hauteur d'une cellule dans un tableau


Sujet :

HTML

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 594
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 594
    Par défaut Fixer la hauteur d'une cellule dans un tableau
    Bonjour à tous, pourriez-vous m'aider?

    Il-y a un code que j'ai repris et dedans on imprime un tableau avec des informations un peux un bon de commande problème le tableau est fait avec des colspan le truc c'est que je veux une taille fixe du tableau et que ne fixe que la largeur, j'ai pu voir qu'on utilisaient des balise avec overflow mais dans le cas d'un colspan la cellule se déforme aussi comment puis je me débrouiller?

  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 228
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 228
    Par défaut
    Bonjour,
    pas tout compris à ton soucis, est ce que tu veux que ton tableau s'affiche sur une seule page ?

    Un bout de code, représentatif, serait le bienvenu.

  3. #3
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 594
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 594
    Par défaut
    Merci de votre réponse, Voici le code du tableau

    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
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    <div style="foat:left;width:100%;height:100%;">
    	<table class="table" style="height:80px;border:1px solid black; table-layout: fixed;" >
    		<tr>
    			<td class="td_etq_3 left" colspan="2"  style="font-size:10px; font-family:Arial;"><?php echo html('REFERENCE'); ?>
    			<a style="font-size:58px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['REFERENCE']); ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size:10px;font-family:Arial;"><?php echo html('INDICE'); ?>
    			<a style="font-size:58px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['INDICE']; ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size:10px;font-family:Arial;"><?php echo html('EMPLACEMENT'); ?>
    			<a style="font-size:38px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NOM_EMPLACEMENT']; ?></a>
    			</td>
    			<td style="font-size:25px; background-color:Gray;-webkit-print-color-adjust:exact;text-align:center;font-family:Arial;" class="td_etq_3 left"  rowspan="6">
     
    			<?php echo html('P'); echo "<br>"; echo html('R'); echo "<br>"; echo html('O');echo "<br>"; echo html('T');echo "<br>"; echo html('O');
                            echo "<br>"; echo html('T');echo "<br>"; echo html('Y');echo "<br>"; echo html('P');echo "<br>"; echo html('E');
                            echo "<br>"; echo html('S');
                            ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan="3" style="font-size:10px;font-family:Arial;"><?php echo html('DESIGNATION'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['DESIGNATION']); ?></a></td>
    			<td class="td_etq_3 left"><?php echo html('DATE ENTREE'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['DATE_RECEPTION']; ?></a></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=2 style="font-size:10px;font-family:Arial;"><?php echo html("QUANTITE");
                            ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            $qte_total = $stock['QTE_PIECE_OK'] + $stock['QTE_PIECE_DRG'] + $stock['QTE_PIECE_NOK'];
                            echo "<br />";
                            echo $qte_total; ?></a></td>
    			<td class="td_etq_3 left"  style="font-size:10px;font-family:Arial;"><?php echo html('FOURNISSEUR'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['NOM_FOURNISSEUR']); ?></a></td>
    			<td class="td_etq_3 left" style="font-size: 10px;font-family:Arial;" ><?php echo html('PROJET'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NUM_PROJET']; ?></a></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan="2" rowspan="2" style="font-size:10px; padding-bottom:95px;font-family:Arial;"><?php echo html('INFORMATIONS'); ?>
    			<?php 
                            echo "<br />";
                            /*
                            On vérifie qu'il existe bien un commentaire de réception
                            si il n'existe pas alors on le remplace par le commentaire général
                            on vérifie aussi le nombre de lettre pour adapter la taille lorsqu'on imprimera
                            */
                            if((strlen($stock['COMMENTAIRE_GENERAL'])+strlen($stock['COMMENTAIRE_STOCK']))>220)
                            {
                                    echo "<a style='font-size:15px;font-family:Arial;'>";
                            }
                            else{
                                    echo "<a style='font-size:20px;font-family:Arial;'>";
                            }
                            
                            if($stock['COMMENTAIRE'] == ' ' or empty($stock['COMMENTAIRE']) )
                            {
                                    echo htmlentities($stock['COMMENTAIRE_GENERAL'].' '.$stock['COMMENTAIRE_STOCK']);
                            }
                            ELSE
                            {  
                                    echo htmlentities($stock['COMMENTAIRE_STOCK']);
                            }
                            // echo htmlentities($stock['COMMENTAIRE_STOCK']); ?></a></td>
    			<td class="td_etq_3 left" style="font-size:10px;font-family:Arial;" >
    			<a style="font-size:28px;font-family:Arial;">
    			<?php if(($stock['QTE_PIECE_OK'] != 0) && ($stock['QTE_PIECE_DRG'] == 0) && ($stock['QTE_PIECE_NOK'] == 0)){
                            echo html('QUALITE: OK'); 
                            }
                            elseif(($stock['QTE_PIECE_OK'] == 0) && ($stock['QTE_PIECE_DRG'] != 0) && ($stock['QTE_PIECE_NOK'] == 0)){
                            echo html('QUALITE: DRG');
                            }
                            elseif(($stock['QTE_PIECE_OK'] == 0) && ($stock['QTE_PIECE_DRG'] == 0) && ($stock['QTE_PIECE_NOK'] != 0)){
                            echo html('QUALITE: NOK');
                            } ?>
    			</a></td>
    			<td class="td_etq_3 left" style="font-size:10px;font-family:Arial;" ><?php echo html('HP/DL INITIALE'); ?>
    			<a style="font-size:20px;"><?php 
                            echo "<br />";
                            echo $stock['NUM_AFFAIRE']; ?></a></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" style="font-size:10px;font-family:Arial;"><?php echo html('PILOTE PROTOS'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $plt_encours['NOM_PERSONNE']; ?></a></td>
    			<td class="td_etq_3 left" style="font-size:10px;font-family:Arial;"><?php echo html('N° LOT'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NUM_EN_COURS_DEG']; ?></a>
    			<img src="barcode.png" border="0" style="height:50px; width:200px;"/>
    			</td>
    		</tr>	
    	</table>
     
     
    	<table class="table" style="height:60px;border:1px solid black;" >
    	<tr>
    			<td class="td_etq_3 left" colspan="2"  style="font-size: 5px;padding-bottom:15px;font-family:Arial;"><?php echo html('REFERENCE'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['REFERENCE']); ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size: 5px;padding-bottom:15px;font-family:Arial;"><?php echo html('INDICE'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['INDICE']; ?></a></td>
    			<td class="td_etq_3 left" colspan="2"  style="font-size: 5px;padding-bottom:15px;font-family:Arial;"><?php echo html('INFORMATIONS'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            /*
                            On vérifie qu'il existe bien un commentaire de réception
                            si il n'existe pas alors on le remplace par le commentaire général
                            on vérifie aussi le nombre de lettre pour adapter la taille lorsqu'on imprimera
                            */
                            if((strlen($stock['COMMENTAIRE_GENERAL'])+strlen($stock['COMMENTAIRE_STOCK']))>220)
                            {
                                    echo "<a style='font-size:7px;font-family:Arial;'>";
                            }
                            else{
                                    echo "<a style='font-size:10px;font-family:Arial;'>";
                            }
                            if($stock['COMMENTAIRE'] == ' ' or empty($stock['COMMENTAIRE']) )
                            {
                                    echo htmlentities($stock['COMMENTAIRE_GENERAL'].' '.$stock['COMMENTAIRE_STOCK']);
                            }
                            ELSE
                            {  
                                    echo htmlentities($stock['COMMENTAIRE_STOCK']);
                            }
                             ?>
    			</td>
    			<td class="td_etq_3 left"  style="font-size:5px;padding-bottom:15px;font-family:Arial;"><?php echo html('FOURNISSEUR'); ?>
    			<a style="font-size:10px;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['NOM_FOURNISSEUR']); ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size: 5px;padding-bottom:15px;font-family:Arial;"><?php echo html('EMPLACEMENT'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NOM_EMPLACEMENT']; ?></a>
    			</td>
    			<td style="font-size:10px; background-color: Gray;-webkit-print-color-adjust:exact;text-align:center;font-family:Arial;" class="td_etq_3 left"  rowspan="3">
     
    			<?php echo html('P'); echo "<br>"; echo html('R'); echo "<br>"; echo html('O');echo "<br>"; echo html('T');echo "<br>"; echo html('O');
                            echo "<br>"; echo html('T');echo "<br>"; echo html('Y');echo "<br>"; echo html('P');echo "<br>"; echo html('E');
                            echo "<br>"; echo html('S');
                            ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan="3" style="font-size:5px;font-family:Arial;"><?php echo html('DESIGNATION'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo htmlentities($stock['DESIGNATION']); ?></a></td>
    			<td class="td_etq_3 left" colspan="2" style="font-size:5px;font-family:Arial;"><?php echo html('N° LOT'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NUM_EN_COURS_DEG']; ?></a>
    			<img src="barcode.png" border="0" style="height:30px;width:100px;" /></td>
    			<td class="td_etq_3 left" style="font-size:5px;font-family:Arial;" ><?php echo html('PROJET'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NUM_PROJET']; ?></a></td>
    			<td class="td_etq_3 left" style="font-size:5px;font-family:Arial;"><?php echo html('DATE ENTREE'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['DATE_RECEPTION']; ?></a></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=3 style="font-size:5px;font-family:Arial;"><?php 
                            if(($stock['QTE_PIECE_OK'] != 0) && ($stock['QTE_PIECE_DRG'] == 0) && ($stock['QTE_PIECE_NOK'] == 0)){
                            echo html('QUANTITE OK'); 
                            }
                            elseif(($stock['QTE_PIECE_OK'] == 0) && ($stock['QTE_PIECE_DRG'] != 0) && ($stock['QTE_PIECE_NOK'] == 0)){
                            echo html('QUANTITE DRG');
                            }
                            elseif(($stock['QTE_PIECE_OK'] == 0) && ($stock['QTE_PIECE_DRG'] == 0) && ($stock['QTE_PIECE_NOK'] != 0)){
                            echo html('QUANTITE NOK');
                            }
                            ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            $qte_total = $stock['QTE_PIECE_OK'] + $stock['QTE_PIECE_DRG'] + $stock['QTE_PIECE_NOK'];
                            echo "<br />";
                            echo $qte_total; ?></a></td>
    			<td class="td_etq_3 left" colspan="2" style="font-size:5px;font-family:Arial;"><?php echo html('PILOTE PROTOS'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $plt_encours['NOM_PERSONNE']; ?></a></td>
    			<td class="td_etq_3 left" colspan=2 style="font-size:5px;font-family:Arial;" ><?php echo html('HP/DL INITIALE'); ?>
    			<a style="font-size:10px;font-family:Arial;"><?php 
                            echo "<br />";
                            echo $stock['NUM_AFFAIRE']; ?></a></td>
    		</tr>
    	</table>
    </div>
    mon responsable de stage veut que quand j'ai beaucoup de texte dans les commentaires cela ne déforme pas la cellule c'est pour cela dedans vous allez voir
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    if((strlen($stock['COMMENTAIRE_GENERAL'])+strlen($stock['COMMENTAIRE_STOCK']))>220)
    			{
    				echo "<a style='font-size:7px;font-family:Arial;'>";
    			}
    			else{
    				echo "<a style='font-size:10px;font-family:Arial;'>";
    			}
    que j'utilise pour diminuer la police et ainsi éviter au maximum que la cellule s'aggrandisse, le problème est que selon le commentaire même si je diminue la police et que le commentaire ne touche pas encore le bas de la cellule le tableau aggrandi la cellule, j'ai également essayé l'attribut overflow dans une div mais la cellule est tout de même déformé après, je ne trouve pas de solution sa serait pour avoir un papier standard car celui-ci est imprimé, merci pour votre aide.

  4. #4
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 594
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 594
    Par défaut
    Finalement j'ai changé l'emplacement des composants et joué sur l'indice du colspan pour essayer d'avoir un document à peux près fixe également la contrôle de caractère et la police

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2010] Affichage d'un contenu d'une cellule dans un tableau Userform
    Par Matrixmax dans le forum Macros et VBA Excel
    Réponses: 0
    Dernier message: 27/12/2012, 18h56
  2. Bordure d'une cellule dans un tableau
    Par hammag dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 24/08/2009, 20h45
  3. Supprimer une cellule dans un tableau
    Par Jinx_ dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 23/08/2009, 21h44
  4. [VBA] Problème récup texte d'une cellule dans un tableau
    Par Marco le Pouillot dans le forum Macros et VBA Excel
    Réponses: 11
    Dernier message: 30/01/2006, 18h06
  5. Fixer la taille d'une cellule d'un tableau
    Par Philofish dans le forum Balisage (X)HTML et validation W3C
    Réponses: 8
    Dernier message: 25/08/2005, 17h04

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