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

Langage PHP Discussion :

Affichage d'une table


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre très actif Avatar de theocbr
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2019
    Messages
    206
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juin 2019
    Messages : 206
    Par défaut Affichage d'une table
    La premiere ligbe s'affiche correctement et apres....

    Les lignes de tableau ne s'affiche pas :

    Nom : rfefezfez.PNG
Affichages : 85
Taille : 154,6 Ko


    css:
    Code CSS : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    table {
    table-layout: fixed;
    border: medium solid #000000;
    border-collapse: collapse;
    width: 40%;
    }
    td, th {
    border: thin solid #6495ed;
    width: 40%;
     
    }

    html/php :

    Code HTML : 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
    <html> 
        <head> 
       <meta charset="utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<title>STATS OFs C&D FOODS FRANCE</title>
    	<link rel="shortcut icon" href="CD FOODS.ico">
    	<link rel="stylesheet" href="http://10.17.178.179/STATS/jquery.mobile/demos/css/themes/default/jquery.mobile-1.4.5.min.css">
    	<link rel="stylesheet" href="http://10.17.178.179/STATS/jquery.mobile/demos/_assets/css/jqm-demos.css">
        <link rel="stylesheet" href="http://10.17.178.179/STATS/jquery.mobile/demos/css/openfonts.css">
    	<script src="http://10.17.178.179/STATS/jquery.mobile/demos/js/jquery.js"></script>
    	<script src="http://10.17.178.179/STATS/jquery.mobile/demos/_assets/js/index.js"></script>
    	<script src="http://10.17.178.179/STATS/jquery.mobile/demos/js/jquery.mobile-1.4.5.min.js"></script>
        <script src="http://10.17.178.179/STATS/jquery.mobile/kiwi.js"></script>
    	<link rel="stylesheet" href="http://10.17.178.179/tab.css">
    	</head> 
        <body>
    <div data-role="page">
           <div data-role="header" data-theme="b">
    	    <a href="http://10.17.178.178/accueilproduction.php" data-role="button" data-icon="home" data-mini="true" data-inline="true" data-iconpos="left">RETOUR</a>
         	  <h1>Production C&D Foods France  </h1>
    		 		  <p><center> Appuyer sur CTRL + bouton voulu pour ouvrir la page dans un nouvel onglet</center></p>
          </div>
          <div data-role="content">
    	   <div class="ui-grid-b my-breakpoint">
     <div class="ui-block-a">
    <?php
    $mysqli = new mysqli("localhost", "anniv", "anniversaire", "AUTOMATES");    if ($mysqli->connect_errno) {
        printf("?hec de la connexion : %s\n", $mysqli->connect_error);
        exit();
        }    
            $reponse = $mysqli->query("SELECT * FROM AUTOMATES.TIMERSIMA");
            ?>
     
     
            <table>
                    <tr>
    					<th>MODIFICATION</th>
                        <th>ID</th>
                        <th>TIMER</th>
                        <th>WEEK</th>
                        <th>OF</th>
                        <th>CODE</th>
                        <th>LINK</th>
                        <th>EQUIPE</th>
    					<th>DESCRIPTION</th>
    					<th>LINE</th>
    					<th>compteur</th>
    					<th>SPEED</th>
    					<th>STATUS</th>
    					<th>D1</th>
    					<th>D2</th>
    					<th>D3</th>
    					<th>D4</th>
    					<th>D5</th>
    					<th>D6</th>
    					<th>D7</th>
    					<th>D8</th>
    					<th>D9</th>
    					<th>D10</th>
    					<th>D11</th>
    					<th>D12</th>
    					<th>JOUR</th>
    					<th>THEORIQUE</th>
    					<th>TEAM</th>
    					<th>JOURPROD</th>
    					<th>STERILISATION</th>
    					<th>FV</th>
    					<th>OSCAR</th>
    					<th>CODIFICATION</th>
    					<th>AP/NP</th>
    					<th>COMMENTAIRES</th>
                    </tr>
     
                <?php   //On affiche les lignes du tableau une à une à l'aide d'une boucle
                while($donnees = mysqli_fetch_array($reponse))
                {
                ?>
                    <tr>
                        <td><a href="">Modifier</a></td>
                        <td><?php echo $donnees['ID'];?></td>
                        <td><?php echo $donnees['TIMER'];?></td>
                        <td><?php echo $donnees['WEEK'];?></td>
                        <td><?php echo $donnees['OF'];?></td>
                        <td><?php echo $donnees['CODE'];?></td>
                        <td><?php echo $donnees['LINK'];?></td>
    					<td><?php echo $donnees['EQUIPE'];?></td>
    					<td><?php echo $donnees['DESCRIPTION'];?></td>
    					<td><?php echo $donnees['LINE'];?></td>
    					<td><?php echo $donnees['compteur'];?></td>
    					<td><?php echo $donnees['SPEED'];?></td>
    					<td><?php echo $donnees['STATUS'];?></td>
    					<td><?php echo $donnees['D1'];?></td>
    					<td><?php echo $donnees['D2'];?></td>
    					<td><?php echo $donnees['D3'];?></td>
    					<td><?php echo $donnees['D4'];?></td>
    					<td><?php echo $donnees['D5'];?></td>
    					<td><?php echo $donnees['D6'];?></td>
    					<td><?php echo $donnees['D7'];?></td>
    					<td><?php echo $donnees['D8'];?></td>
    					<td><?php echo $donnees['D9'];?></td>
    					<td><?php echo $donnees['D10'];?></td>
    					<td><?php echo $donnees['D11'];?></td>
    					<td><?php echo $donnees['D12'];?></td>
    					<td><?php echo $donnees['JOUR'];?></td>
    					<td><?php echo $donnees['THEORIQUE'];?></td>
    					<td><?php echo $donnees['TEAM'];?></td>
    					<td><?php echo $donnees['JOURPROD'];?></td>
    					<td><?php echo $donnees['STERILISATION'];?></td>
    					<td><?php echo $donnees['FV'];?></td>
    					<td><?php echo $donnees['OSCAR'];?></td>
    					<td><?php echo $donnees['CODIFICATION'];?></td>
    					<td><?php echo $donnees['AP/NP'];?></td>
    					<td><?php echo $donnees['COMMENTAIRES'];?></td>
                    </tr>
    				</table>
                <?php
                }   //fin de la boucle, le tableau contient toute la BDD
                $mysqli->close();  //deconnection de mysql
                ?>
            <table>
    </div>
    </div>
       </body>
    </html>

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

    1- Regarde le code HTML généré ("Ctrl"+"U").

    La balise </table> doit être en dehors du while.

    2- Ajoute aussi les balises <thead> et <tbody>.

  3. #3
    Membre très actif Avatar de theocbr
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2019
    Messages
    206
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 25
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juin 2019
    Messages : 206
    Par défaut
    Bonjour , j'ai réussi , merci

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

Discussions similaires

  1. [SQL] Forcer l'affichage d'une table SQL malgrès des collones (jointure) vide
    Par arnaudperfect dans le forum PHP & Base de données
    Réponses: 18
    Dernier message: 19/04/2007, 11h18
  2. [MySQL] Affichage d'une table sous forme d'un tableau via PHP
    Par CYCLOPE91440 dans le forum PHP & Base de données
    Réponses: 4
    Dernier message: 16/01/2007, 20h25
  3. affichage d'une table en javascript
    Par benkunz dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 16/11/2006, 18h33
  4. Affichage d'une table MySQL
    Par Paniez dans le forum Requêtes
    Réponses: 2
    Dernier message: 26/07/2006, 14h09
  5. Problème avec affichage d'une table modifiée
    Par auriolbeach dans le forum Access
    Réponses: 6
    Dernier message: 31/10/2005, 16h45

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