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

AJAX Discussion :

Redéfinir le nombre de lignes d'une table


Sujet :

AJAX

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut Redéfinir le nombre de lignes d'une table
    Bonjour a tous,

    mon objectif est de mettre une taille sur mon tableau voici l'image

    Nom : Annotation 2019-04-25 165519.jpg
Affichages : 327
Taille : 175,9 Ko

    En fait j'aimerais que quand on sectionne un le nombre de lignes à afficher cela s'applique mon problème est que je ne maitrise pas Ajax ni le JavaScript... voici code
    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
    <div class="panel monFiltre">
                <div class="panel-heading pull-left">              
                    <button class="btn btn-default btn-filtre"><i class="material-icons ">filter_list</i> Filtrer</button>
                </div>  
                <div class="panel-heading pull-right">              
                    <select class="custom-select my-1 mr-sm-2" name="afficherNbLigne" id="afficherNbLigne">
                        <option value="">Tous</option>
                        <option value="">10</option>
                        <option value="">20</option>
                        <option value="">30</option>                   
                    </select>                                
                </div>          
                <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                    </tbody>
                </table>
            </div> <!-- fin du panel -->


    j'ai besoin de vôtres aides s'il vous plaît merci d'avance !

  2. #2
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Salut,

    Tu as 2 choix :
    soit coté serveur tu calcule le nombre de ligne et tu ajoute l attribut selected="selected"

    soit coté javascript :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    function selectNb(){
        var tab = document.getElementById('tblMembre');
        var nb = tab.rows.length - 1;
        var nbLigne = 0;
        if (nb<=10) nbLigne = 1;
        if (nb<=20 && nb>10) nbLigne = 2;
        if (nb<=30 && nb>20) nbLigne = 3;
        document.getElementById('afficherNbLigne').selectedIndex=nbLigne;
    }
     
    window.onload = selectNb();



    PS : tu as un TR orphelin qui traine après ton tbody

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Bonjour, merci pour ta reponse

    mais du coup la fonction selectNb() je dois l'appeler dans mon select non ? avec un évent ?

  4. #4
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Si tu regarde le bout de code que je t'ai mit.

    elle est appelé sur le onload de ta fenêtre.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    window.onload = selectNb();

  5. #5
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Je l'ai bien vu mais ça ne me charge pas mon tableau

    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
    <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
                    <script>
                        function selectNb(){
                        var tab = document.getElementById('tblMembre');
                        var nb = tab.rows.length - 1;
                        var nbLigne = 0;
                        if (nb<=10) nbLigne = 1;
                        if (nb<=20 && nb>10) nbLigne = 2;
                        if (nb<=30 && nb>20) nbLigne = 3;
                        document.getElementById('afficherNbLigne').selectedIndex=nbLigne;
                        }
                        window.onload = selectNb();
                    </script>
                </table>

  6. #6
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Tu as mis ton bloque de script au mauvais endroit et tu ne l as pas typé.
    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
    <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
     
                </table>
    <script type="text/javascript">
                        function selectNb(){
                        var tab = document.getElementById('tblMembre');
                        var nb = tab.rows.length - 1;
                        var nbLigne = 0;
                        if (nb<=10) nbLigne = 1;
                        if (nb<=20 && nb>10) nbLigne = 2;
                        if (nb<=30 && nb>20) nbLigne = 3;
                        document.getElementById('afficherNbLigne').selectedIndex=nbLigne;
                        }
                        window.onload = selectNb();
                    </script>

  7. #7
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Toujours pas...
    voila le code complet de la page

    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
    <div class="page-header header-filter" data-parallax="true" style="background-image: url('assets/img/bg3.jpg')">
        <div class="container">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto">
                    <div class="brand text-center">
                        <h1>Nos Membres</h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
     
    <div class="main main-raised">
        <div class="container">
        <div class="table-responsive-xl">
            <div class="panel monFiltre">
                <div class="panel-heading pull-left">              
                    <button class="btn btn-default btn-filtre"><i class="material-icons ">filter_list</i> Filtrer</button>
                </div>  
                <div class="panel-heading pull-right">              
                    <select class="custom-select my-1 mr-sm-2" name="afficherNbLigne" id="afficherNbLigne">
                        <option value="">Tous</option>
                        <option value="">10</option>
                        <option value="">20</option>
                        <option value="">30</option>                   
                    </select>                                
                </div>          
                <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
                </table>
            </div> <!-- fin du panel -->
          </div> <!-- fin du responsive -->
          <script type="text/javascript">
            function selectNb(){
                var tab = document.getElementById('tblMembre');
                var nb = tab.rows.length - 1;
                var nbLigne = 0;
                if (nb<=10) nbLigne = 1;
                if (nb<=20 && nb>10) nbLigne = 2;
                if (nb<=30 && nb>20) nbLigne = 3;
                document.getElementById('afficherNbLigne').selectedIndex=nbLigne;
            }
            window.onload = selectNb();
            </script>
        </div>  <!-- fin du container -->
    </div> <!-- fin du corps du site -->

  8. #8
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Bon je ne vois pas trop pourquoi mais essaie ceci :
    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
    <div class="page-header header-filter" data-parallax="true" style="background-image: url('assets/img/bg3.jpg')">
        <div class="container">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto">
                    <div class="brand text-center">
                        <h1>Nos Membres</h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
     
    <div class="main main-raised">
        <div class="container">
        <div class="table-responsive-xl">
            <div class="panel monFiltre">
                <div class="panel-heading pull-left">              
                    <button class="btn btn-default btn-filtre"><i class="material-icons ">filter_list</i> Filtrer</button>
                </div>  
                <div class="panel-heading pull-right">              
                    <select class="custom-select my-1 mr-sm-2" name="afficherNbLigne" id="afficherNbLigne">
                        <option value="">Tous</option>
                        <option value="">10</option>
                        <option value="">20</option>
                        <option value="">30</option>                   
                    </select>                                
                </div>          
                <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
                </table>
            </div> <!-- fin du panel -->
          </div> <!-- fin du responsive -->
          <script type="text/javascript">
            function selectNb(){
                var tab = document.getElementById('tblMembre');
                var nb = tab.rows.length - 1;
                var nbLigne = 0;
                if (nb<=10) nbLigne = 1;
                if (nb<=20 && nb>10) nbLigne = 2;
                if (nb<=30 && nb>20) nbLigne = 3;
                document.getElementById('afficherNbLigne').selectedIndex=nbLigne;
            }
            document.addEventListener("DOMContentLoaded", function(event) { 
                       selectNb();
                    });
            </script>
        </div>  <!-- fin du container -->
    </div> <!-- fin du corps du site -->

  9. #9
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    ça ne marche toujours pas.. mais merci pour ton aide

  10. #10
    Modérateur

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

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 955
    Points : 44 103
    Points
    44 103
    Par défaut
    Bonjour,
    est ce que TOUTES tes données sont chargées ou est ce que tu cherches à faire une « vraie » pagination ?

    PHP pagination

  11. #11
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Bonjour,

    oui toutes les données sont présentes sur la page deja et je veux charger le nombre de ligne a afficher avec mon select

  12. #12
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Re Salut,

    Bon on est pas au bon endroit pour ça mais si tu veux il existe la solution numéro 1 dont je te parlais :

    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
    <div class="page-header header-filter" data-parallax="true" style="background-image: url('assets/img/bg3.jpg')">
        <div class="container">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto">
                    <div class="brand text-center">
                        <h1>Nos Membres</h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
     
    <div class="main main-raised">
        <div class="container">
        <div class="table-responsive-xl">
            <div class="panel monFiltre">
                <div class="panel-heading pull-left">              
                    <button class="btn btn-default btn-filtre"><i class="material-icons ">filter_list</i> Filtrer</button>
                </div>  
                <div class="panel-heading pull-right">              
                    <select class="custom-select my-1 mr-sm-2" name="afficherNbLigne" id="afficherNbLigne">
    <?php $nb = count($lesMembres); ?> 
                        <option value="all" <?php if (nb>30)echo 'selected="selected"';?>>Tous</option>
                        <option value="10" <?php if (nb<=10)echo 'selected="selected"';?>>10</option>
                        <option value="20" <?php if if (nb<=20 && nb>10)echo 'selected="selected"';?>>20</option>
                        <option value="30" <?php if (nb<=30 && nb>20)echo 'selected="selected"';?>>30</option>                   
                    </select>                                
                </div>          
                <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
                </table>
            </div> <!-- fin du panel -->
          </div> <!-- fin du responsive -->
        </div>  <!-- fin du container -->
    </div> <!-- fin du corps du site -->

  13. #13
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Bonjour !

    j'ai essayé et ça me donne ça comme erreur


    Nom : Annotation 2019-05-06 102812.jpg
Affichages : 322
Taille : 219,3 Ko

  14. #14
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Désolé, un copier coller un peu rapide :

    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
    <div class="page-header header-filter" data-parallax="true" style="background-image: url('assets/img/bg3.jpg')">
        <div class="container">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto">
                    <div class="brand text-center">
                        <h1>Nos Membres</h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
     
    <div class="main main-raised">
        <div class="container">
        <div class="table-responsive-xl">
            <div class="panel monFiltre">
                <div class="panel-heading pull-left">              
                    <button class="btn btn-default btn-filtre"><i class="material-icons ">filter_list</i> Filtrer</button>
                </div>  
                <div class="panel-heading pull-right">              
                    <select class="custom-select my-1 mr-sm-2" name="afficherNbLigne" id="afficherNbLigne">
    <?php $nb = count($lesMembres); ?> 
                        <option value="all" <?php if ($nb>30)echo 'selected="selected"';?>>Tous</option>
                        <option value="10" <?php if ($nb<=10)echo 'selected="selected"';?>>10</option>
                        <option value="20" <?php if if ($nb<=20 && $nb>10)echo 'selected="selected"';?>>20</option>
                        <option value="30" <?php if ($nb<=30 && $nb>20)echo 'selected="selected"';?>>30</option>                   
                    </select>                                
                </div>          
                <table class="table table-striped" id="tblMembre" style=" width:100%; border:2px solid #00BCD4;">
                    <thead>
                        <tr class="filtre">
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Genre" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Nom" disabled></span></th> 
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Prenom" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Téléphone" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Email" disabled></span></th>
                            <th><span class="bmd-form-group"><input type="text" class="form-control" placeholder="Secteur" disabled></span></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="row-content">
                        <?php
                            foreach($lesMembres as $unMembre)
                            {
                            $genre = $unMembre['genre'];
                            $nom = $unMembre['nom'];
                            $prenom = $unMembre['prenom'];
                            $tel = $unMembre['tel'];
                            $email = $unMembre['email'];
                            $nomSecteur = $unMembre['nomSecteur'];
                        
                            echo "<tr>
                                    <td>$genre</td> 
                                    <td style='text-transform: uppercase;'>$nom</td>
                                    <td>$prenom</td> 
                                    <td>$tel</td>
                                    <td>$email</td>
                                    <td>$nomSecteur</td>                                
                                    </tr>";
                            }
                        ?>
                        </tr>
                    </tbody>
                </table>
            </div> <!-- fin du panel -->
          </div> <!-- fin du responsive -->
        </div>  <!-- fin du container -->
    </div> <!-- fin du corps du site -->

  15. #15
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    c'est pas grave, cette fois l’erreur ne s'affiche plus mais pas de changement dans mon tableau. Toutes les données s'affichent peu import la valeur que je choisi (tout, 10, 20 etc)

  16. #16
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Ah ok, je n'y étais pas du tout.
    Tu veux une pagination ou tronquer ton tableau ?

  17. #17
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Euuuu je veux afficher le nombre de ligne selon le choix dans mon select

  18. #18
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    Bon vu que tu n'as aucune exigence je te propose une solution avec un peu de css

    je t ai fait un jsFiddle pour que tu la vois en fonctionnement :

    https://jsfiddle.net/u86bz9og/2/

    ça te convient ?

  19. #19
    Futur Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2015
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 57
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2015
    Messages : 36
    Points : 7
    Points
    7
    Par défaut
    Bonjour, désolé de pas avoir répondu plutôt
    merci beaucoup, ça marche maintenant juste que toutes les données s'affichent dans la colonne "genre" c'est a cause de la classe "aff_all"

    Nom : Annotation 2019-05-06 102812.jpg
Affichages : 278
Taille : 219,3 Ko

    comme dans votre code https://jsfiddle.net/u86bz9og/2/

  20. #20
    Membre actif
    Inscrit en
    Août 2006
    Messages
    191
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 191
    Points : 263
    Points
    263
    Par défaut
    oui, désolé.
    J'ai mis la mauvaise propriété dans le display.

    il faut utilise table-row plutôt que block
    Exemple : https://jsfiddle.net/8qewL1kn/1/

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. [Tableau]comment connaitre la taille d'un tableau à 2 dimensions
    Par Kyti dans le forum Collection et Stream
    Réponses: 4
    Dernier message: 22/04/2005, 10h27
  2. Changer la taille d'un tableau déjà initialisé
    Par totofweb dans le forum C++
    Réponses: 2
    Dernier message: 25/07/2004, 15h55
  3. taille d'un tableau
    Par monstour dans le forum ASP
    Réponses: 3
    Dernier message: 24/06/2004, 15h16
  4. Taille maximum de tableau en Delphi
    Par yannick37 dans le forum Langage
    Réponses: 5
    Dernier message: 03/03/2004, 13h18
  5. qbasic : taille d'un tableau
    Par clood200 dans le forum Basic
    Réponses: 2
    Dernier message: 16/09/2003, 07h26

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