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

Mise en page CSS Discussion :

Colonne td qui ne se colore pas


Sujet :

Tableau en CSS

  1. #1
    Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2013
    Messages
    120
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2013
    Messages : 120
    Points : 51
    Points
    51
    Par défaut Colonne td qui ne se colore pas
    Bonjour à tous!!!

    Voila je suis en train de faire une page avec un tableau afin de créer un étiquette pour faire des impressions. J'essaie de colorer une td en gris mais je ne sais pas pourquoi elle ne veux pas se colorer. J'ai essayé avec d'autres couleur sans aucun succès. Voici le code de mon 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
    <!doctype html>
    <script type="text/javascript">
      window.onload = function() { 
        window.print(); 
      }
    </script>
    <link href="../../../css/formulaire.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/imprime.css" rel="stylesheet" type="text/css" />
    <div style="foat:left;width:100%;height:100%;">
    	<table class="table" style="height:48%;border:1px solid black;" >
    		<tr>
    			<td class="td_etq_3 left" colspan="2"  style="font-size: 10px;"><?php echo html('REFERENCE'); ?>
    			<a style="font-size: 20px;"><?php 
    			echo "<br />";
    			echo "G1036025" ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size: 10px;"><?php echo html('INDICE'); ?>
    			<a style="font-size: 20px;"><?php 
    			echo "<br />";
    			echo "1" ?></a></td>
    			<td class="td_etq_3 left" style="width:30%;font-size: 10px;"><?php echo html('EMPLACEMENT'); ?>
    			<a style="font-size: 20px;"><?php 
    			echo "<br />";
    			echo $stock['NOM_EMPLACEMENT']; ?></a>
    			</td>
    			<td style="font-size:25px; background-color: gray;" class="td_etq_3 left"  rowspan="6"   > <!-- la td que je souhaite colorer-->
     
    			<?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;"><?php echo html('DESIGNATION'); ?>
    			<a style="font-size:20px;"><?php 
    			echo "<br />";
    			echo "MÉCA 240SAT (DIAPH 1011541)"; ?></a></td>
    			<td class="td_etq_3 left"><?php echo html('DATE ENTREE'); ?>
    			<a style="font-size: 20px;"><?php 
    			echo "<br />";
    			echo "19/05/15"; ?></a></td>
    		</tr>
    		<tr>
    			<td class="td_etq_4 left" colspan=2><?php echo html('DESIGNATION'); ?></td>
    			<td class="td_etq_6 left" colspan=2 ><?php echo html($info['DESIGNATION_VALEO_BESOIN']); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=2 ><?php echo html('QUANTITE'); ?></td>
    			<td class="td_etq_3 left" ><?php echo html('CLIENT'); ?></td>
    			<td class="td_etq_3 left" ><?php echo html('PROJET'); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_9 left" colspan=2><?php echo html($info['QUANTITE_BESOIN']); ?></td>
    			<td class="td_etq_2 left"><?php echo html($info['LABEL_CLIENT']); ?></td>
    			<td class="td_etq_2 left">
    				<?php echo html($info['NUM_PROJET']); ?>
    				<br class="br"/>
    				<?php echo html($info['NOM_PROJET']); ?>
    			</td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=2><?php echo html('OPERATIONS RESTANTES'); ?></td>
    			<td class="td_etq_3 left" colspan=2><?php echo html('N°LOT'); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_2 left" colspan=2 rowspan=3></td>
    			<td class="td_etq_2 left" colspan=2><?php echo html($info['NUM_LOT']); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=2><?php echo html('DATE D\'ENTREE'); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_2 left" colspan=2><?php echo html($info['DATE_LOT']); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_3 left" colspan=2 ><?php echo html('COMMENTAIRE'); ?></td>
    			<td class="td_etq_3 left" colspan=2><?php echo html('PILOTE'); ?></td>
    		</tr>
    		<tr>
    			<td class="td_etq_2 left" colspan=2 ></td>
    			<td class="td_etq_5 left" colspan=2><?php echo html($prs_p['PRENOM_PERSONNE'].' '.$prs_p['NOM_PERSONNE']); ?></td>
    		</tr>
    		<img src="barcode.png" border="0" />
    	</table>
     
    </div>
    Si quelqu'un pouvait me dire d'ou viens le problème car la je bloque. Merci d'avance.

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    le code fourni n'a aucune utilité.

    Il faut :
    • le code CSS
    • le code HTML généré (sans PHP)

  3. #3
    Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2013
    Messages
    120
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2013
    Messages : 120
    Points : 51
    Points
    51
    Par défaut
    Ah d'accord eh bien le voici:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <td style="font-size:25px; background-color: yellow;" class="td_etq_3 left"  rowspan="6"   >
    J'ai mêlé le CSS et le HTML car vu qu'il n'y a pas beaucoup de de css à mettre dans mon étiquette je met le style sur la balise td directement.

  4. #4
    Membre à l'essai
    Homme Profil pro
    Développeur Web
    Inscrit en
    Août 2014
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Août 2014
    Messages : 13
    Points : 22
    Points
    22
    Par défaut
    Il faudrait avoir le contenu des fichiers .css

    En forçant avec !important ça fonctionne ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <td style="font-size:25px; background-color: yellow !important;" class="td_etq_3 left"  rowspan="6"   >

  5. #5
    Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2013
    Messages
    120
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2013
    Messages : 120
    Points : 51
    Points
    51
    Par défaut
    Ah oui d'accord les voici:

    Le css pour l'impression:

    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
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    .table{
    float:left;
    width:100%;
    border-collapse:collapse;
    line-height: normal;
    vertical-align: middle;
    border: 1px solid black;
    font-family:Arial, Helvetica, sans-serif;
     
    }
     
    .td{
    font-size:9pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    }
     
    .td_etq{
    font-size:20pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_2{
    font-size:16pt;
    padding:2px 4px;
    color:black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    font-weight: bold;
    }
     
    .td_etq_3{
    font-size:10pt;
    padding:2px 4px;
    color:black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-top: 1px solid black;
    font-weight: bold;
    }
     
    .td_etq_4{
    font-size:10pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_5{
    font-size:14pt;
    padding:2px 4px;
    color:black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    font-weight: bold;
    }
     
    .td_etq_6{
    font-size:14pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_7{
    font-size:38pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_9{
    font-size:34pt;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_8{
    font-size:34pt;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_etq_10{
    font-size:14pt;
    padding:2px 4px;
    color:black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-top: 1px solid black;
    font-weight: bold;
    }
     
    .td_g{
    font-size:9pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_no_b{
    font-size:9pt;
    padding:2px 4px;
    color:black;
    }
     
    .td_titre_1{
    font-size:9pt;
    padding:2px 4px;
    color:black;
    }
     
    .td_gg{
    font-size:12pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .col_1{
    width:20%;
    }
     
    .col_2{
    width:30%;
    }
     
    .col_3{
    width:50%;
    }
     
    .col_4{
    width:50%;
    }
     
    .th_tab{
    font-size:7pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .td_tab{
    font-size:7pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    }
     
    .td_titre{
    font-size:11pt;
    border-left: 3px double black;
    border-right: 3px double black;
    padding:2px 4px;
    color:black;
    }
     
    .td_titre_bl{
    font-size:13pt;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
    .center {
    text-align:center;
    }
     
    .left {
    text-align:left;
    }
     
    .right {
    text-align:right;
    }
     
    th{
    font-size:9pt;
    font-weight:normal;
    border: 1px solid black;
    padding:6px 5px;
    }
     
    .td2{
    font-size:9pt;
    text-align:center;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-top: 1px solid black;
    padding:4px 4px;
    color:black;
    }
     
    .table_no_b{
    float:left;
    width:100%;
    border-collapse:collapse;
    line-height: normal;
    vertical-align: middle;
    font-family:Arial, Helvetica, sans-serif;
    }
     
     
    .td_tab_al{
    font-size:9pt;
    padding:2px 4px;
    border: 1px solid black;
    color:black;
    max-width:200px;
    }
     
    .td_no_b{
    font-size:9pt;
    padding:2px 4px;
    color:black;
    }
     
    .td_no_blr{
    font-size:9pt;
    padding:2px 4px;
    border-left: 1px solid black;
    border-right: 1px solid black;
    color:black;
    }
     
    .td_no_blr_p{
    height:20px;
    font-size:9pt;
    padding:2px 4px;
    border-left: 1px dashed black;
    border-right: 1px dashed black;
    color:black;
    }
     
     
     
    .td_no_blrb{
    font-size:9pt;
    padding:2px 4px;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    color:black;
    }
     
    .td_no_blrt{
    font-size:9pt;
    padding:2px 4px;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-top: 1px solid black;
    color:black;
    font-weight: bold;
    }
     
    .td_no_btb{
    font-size:9pt;
    padding:2px 4px;
    color:black;
    }
     
    .td_titre_2{
    font-size:10pt;
    border: 1px solid black;
    padding:2px 4px;
    color:black;
    font-weight: bold;
    }
     
     
    .td_lrb_d{
    height:20px;
    font-size:9pt;
    padding:2px 4px;
    border-left: 1px dashed black;
    border-right: 1px dashed black;
    border-bottom: 1px dashed black;
    color:black;
    }
     
     
    .td_titre_d{
    height:20px;
    font-size:10pt;
    border: 1px dashed black;
    padding:2px 4px;
    color:black;
    }
    Ah je connaissait pas "!important" mais j'ai testé et lorsque ma fenêtre d'impression s'ouvre pour imprimer l'étiquette je vois a un moment ma colonne se colorer mais une fois complètement chargé elle redeviens blanche.

  6. #6
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 112
    Points
    44 112
    Par défaut
    Bonjour,
    juste une petite question au passage, l'impression des backgrounds est activée ?

  7. #7
    Membre du Club
    Homme Profil pro
    Inscrit en
    Mai 2013
    Messages
    120
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2013
    Messages : 120
    Points : 51
    Points
    51
    Par défaut
    Bonjour,

    Ah merci de me l'avoir posé car je savais pas du tout que les navigateurs bloquaient l'impression des background. Du coup j'ai pu chercher et j'ai trouvé comment faire merci!

    J'ai trouvé ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    -webkit-print-color-adjust:exact;
    Le code au final:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <td style="font-size:25px; background-color: Gray;-webkit-print-color-adjust:exact;" class="td_etq_3 left"  rowspan="6">
    Encore merci pour ta question sinon j'allais continuer dans la mauvaise direction.

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

Discussions similaires

  1. Ascenseur qui ne se colore pas
    Par lucaordi dans le forum Mise en page CSS
    Réponses: 4
    Dernier message: 12/08/2008, 22h07
  2. Font qui ne se répète pas en vertical sur des colonnes
    Par GregBond007 dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 09/10/2007, 18h52
  3. table colonne qui ne s'elargit pas
    Par wincroc dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 21/05/2007, 20h27
  4. excel: colonne qui ne s'affiche pas dans une liste
    Par fast&furious dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 19/07/2006, 18h12
  5. Réponses: 15
    Dernier message: 22/07/2005, 09h49

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