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 :

Un tableau en css


Sujet :

Tableau en CSS

  1. #1
    Membre Expert

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

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 588
    Par défaut Un tableau en css
    Bonjour à tous,

    Pourriez-vous m'aider?
    Voilà mon problème je fais une mise en page avec un tableau ou j'obtients mes résultats avec du php, problème quand je sors un documents selon la taille des données les commentaires par exemple cela explose les cellules, j'aimerais donc savoir si d'après vous directement faire la présentation en css avec des div résoudrait le problème sachant que la présentation à vraiment une forme de tableau avec les label et ensuite en dessous les données.

    Merci n'hésitez pas si je n'ai aps était assez claire.

  2. #2
    Membre éclairé Avatar de Hijack
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2011
    Messages
    30
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Novembre 2011
    Messages : 30
    Par défaut Un tableau sert à faire... un tableau...
    Bonjour kevin254kl,

    si tu dois afficher un tableau, il n'y a rien de plus préconisé que d'utiliser les tableaux en HTML...
    Je ne pense pas que tu gagnerais du temps en le réalisant en DIV, au contraire.

    Concernant l'explosion des cellules, sont-elles correctement formatées ? Est-ce que leur taille, leurs attributs, sont adaptées aux données qu'elles vont recevoir ?

    Sans plus de précisions de ta part il va être difficile de t'aider.

  3. #3
    Membre Expert

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

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 588
    Par défaut
    Bonjour et merci, c'est cellule vont recevoir des donnés comme des commentaires sur des produits par exemple, avec un tableau je suis obligé de diminuer la taille de police selon le nombre de caractères pour avoir un tableau fixe de plus je pensais qu'une présentation avec un tableau était un peux dépassé?

  4. #4
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    1/ tout dépend ce que tu appelles "tableau"...
    Une <table> sert à afficher des données tabulaires. Ce qui semble bien être ton cas.

    2/ montrer ton code (CSS + HTML* sans PHP) est recommandé si tu espères une réponse...
    *= code source généré ("Ctrl" + "U")

    + une(des) copie(s) d'écran, pour visualiser le problème.

  5. #5
    Membre Expert

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

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 588
    Par défaut
    Merci pour la réponse, une dernière question du coups quand vaut-il mieux utiliser du css et quand vaut-il mieux utiliser un <table>?

  6. #6
    Invité
    Invité(e)
    Par défaut
    L'un n'empêche pas l'autre.

  7. #7
    Membre Expert

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

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 588
    Par défaut
    Du coup pour un tableau fixe quelque soit le contenu quel est la méthode conseillé pour la largeur et hauteur des cellules?

  8. #8
    Invité
    Invité(e)
    Par défaut
    Ta question n'a pas de bon sens. Tabernacle.

    Et on n'a toujours pas vu une seule ligne de ton code.
    Ni de copie d'écran montrant le problème.

    Et ça ne te ferait pas de mal de lire quelques tutos :


  9. #9
    Membre Expert

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

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 588
    Par défaut
    Oui mais je me suis mal expliqué voilà mon code désolé de le poster si tard :

    Code php : 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
    <?php
    include("../../../require/jpdf/fpdf.php");
    include("../../../connexion.php");
    include("../../../require/pi_barcode.php"); 
    include("../../../require/fonction_quote.php");
    include("../class/class_besoin.php");
    session_start();
    //var_dump($_SESSION['id_stock']);
    $req_stock = "SELECT NOM_PERSONNE,NUM_BL,NUM_EN_COURS_DEG,QUANTITE_RECU,NUM_PROJET,DESIGNATION,REFERENCE,POP_STOCK.COMMENTAIRE AS COMMENTAIRE,
    			NOM_EMPLACEMENT,TO_CHAR(DATE_RECEPTION,'DD/MM/YYYY') as DATE_RECEPTION,NUM_AFFAIRE,PILOTE_EN_COURS,INDICE,NOM_FOURNISSEUR,
    			QTE_PIECE_OK,QTE_PIECE_DRG,QTE_PIECE_NOK,COMMENTAIRE_STOCK
    			FROM POP_STOCK
    			LEFT JOIN POP_EN_COURS ON POP_EN_COURS.ID_EN_COURS = POP_STOCK.ID_EN_COURS 
    			LEFT JOIN POP_PROJET ON POP_PROJET.ID_PROJET = POP_EN_COURS.ID_PROJET
    			LEFT JOIN POP_DM ON POP_DM.ID_DM = POP_EN_COURS.ID_DM
    			LEFT JOIN POP_PERSONNE ON POP_STOCK.ID_PERSONNE = POP_PERSONNE.ID_PERSONNE
    			LEFT JOIN POP_EMPLACEMENT ON POP_STOCK.ID_EMPLACEMENT = POP_EMPLACEMENT.ID_EMPLACEMENT
    			LEFT JOIN POP_FOURNISSEUR ON POP_FOURNISSEUR.ID_FOURNISSEUR = POP_EN_COURS.ID_FOURNISSEUR
    			WHERE ID_STOCK = ".$_SESSION['id_stock'];
    $sta_stock = oci_parse($conn, $req_stock);
    oci_execute($sta_stock,OCI_COMMIT_ON_SUCCESS);
    $stock = oci_fetch_assoc($sta_stock);	
     
    $req_plt_encours="SELECT NOM_PERSONNE,ID_PERSONNE FROM POP_PERSONNE WHERE ID_PERSONNE = ".$stock['PILOTE_EN_COURS'];
    $sta_plt_encours = oci_parse($conn, $req_plt_encours);
    oci_execute($sta_plt_encours,OCI_COMMIT_ON_SUCCESS);
    $plt_encours = oci_fetch_assoc($sta_plt_encours);
     
     
    $num_encour_deg=str_replace('-','',$stock['NUM_EN_COURS_DEG']);
     
     
    // instanciation
    $bc = new pi_barcode();
     
    // Le code a générer
    $bc->setCode($num_encour_deg);
    // Type de code : EAN, UPC, C39...
    $bc->setType('C128');
    // taille de l'image (hauteur, largeur, zone calme)
    //    Hauteur mini=15px
    //    Largeur de l'image (ne peut être inférieure a
    //        l'espace nécessaire au code barres
    //    Zones Calmes (mini=10px) à gauche et à droite
    //        des barres
    $bc->setSize(80, 150, 10);
     
    // Texte sous les barres :
    //    'AUTO' : affiche la valeur du codes barres
    //    '' : n'affiche pas de texte sous le code
    //    'texte a afficher' : affiche un texte libre
    //        sous les barres
    $bc->setText('AUTO');
     
    // Si elle est appelée, cette méthode désactive
    // l'impression du Type de code (EAN, C128...)
    $bc->hideCodeType();
     
    // Couleurs des Barres, et du Fond au
    // format '#rrggbb'
    $bc->setColors('#000000', '#FFFFFF');
    // Type de fichier : GIF ou PNG (par défaut)
    $bc->setFiletype('PNG');
     
    // envoie l'image dans un fichier
    $bc->writeBarcodeFile('barcode.png');
    // ou envoie l'image au navigateur
     //$bc->showBarcodeImage();
     
     
     
     
    ?>
    <!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:80px;border:1px solid black;" >
    		<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'); ?>
    			<a style="font-size:20px;font-family:Arial;"><?php 
    			echo "<br />";
    			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 />";
    			echo htmlentities($stock['COMMENTAIRE']); ?>
    			</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>

    voilà mon tableau mais je pense vous avez répondu à ma question merci encore.

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

Discussions similaires

  1. Problème de tableau HTML / CSS
    Par laulau37 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 8
    Dernier message: 03/07/2007, 10h46
  2. tableau recapitulatif Css
    Par mello dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 14/06/2007, 13h54
  3. Tableau et css
    Par exorus dans le forum Mise en page CSS
    Réponses: 18
    Dernier message: 31/05/2006, 18h57
  4. cellules d'un tableau xhtml css
    Par Bibouda dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 04/01/2006, 12h55
  5. Tableau et css
    Par LeDoc dans le forum Mise en page CSS
    Réponses: 9
    Dernier message: 27/07/2005, 11h43

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