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 :

Positionner un <table> dans une <div>


Sujet :

Positionnement en CSS

  1. #1
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut Positionner un <table> dans une <div>
    Bonjour,
    ça fait plusieurs jours que j'essai de positionner mon tableau en bas de ma div

    Explication
    J'ai une div "header" avec en fond une bannière à laquelle je veux ajouter des liens en bas dans un tableau.
    Voici l'html
    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
    <div id="header">
    <table class="maTable" width="900" border="0" cellspacing="0" cellpadding="0">
          <tr>
          <tr>
              <td><div align="center">
              <a href="index.html">Accueil</a>
            </div></td>
              <td><div align="center">
                <a href="tarifs.html">Prestations et tarifs</a>
              </div></td>
              <td><div align="center">         
                <a href="profil.html">Mon profil</a>
              </div></td>
              <td><div align="center">
                <a href="contact.html">Me contacter</a></td>
          </tr>
        </table>
      </div>
    Et le CSS :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    .maTable
    {
    	vertical-align:bottom;
    }
     
    .oneColLiqCtrHdr #header
     {
    	background: #DDDDDD;
    	padding: 0 10px 0 0; 
    	background-image: url(header1.png);
    	height: 321px;
     
    }
    Mais le tableau ne veut pas aller se mettre en bas de ma div et mes liens sont pas placé dans la barre que j'ai prévu à cet effet.

    Cordialement

  2. #2
    Membre habitué
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Août 2008
    Messages
    73
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Août 2008
    Messages : 73
    Points : 195
    Points
    195
    Par défaut
    Bonjour,

    Deux remarques :

    1°) Pourquoi le double <tr> ?
    2°) Le dernier n'est pas fermé.

    Ces petits soucis réglés, on devrait y voir plus clair...

  3. #3
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    En effet erreurs d’inattention cependant ne change rien au problème :/

  4. #4
    Expert éminent sénior

    Avatar de FirePrawn
    Homme Profil pro
    Consultant technique
    Inscrit en
    Mars 2011
    Messages
    3 179
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Consultant technique

    Informations forums :
    Inscription : Mars 2011
    Messages : 3 179
    Points : 19 373
    Points
    19 373
    Par défaut
    Essaie :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    .maTable
    {
    	vertical-align:bottom;
                 display:table-cell;
    }

  5. #5
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    Grr toujours pas ce satané tableau ne veut pas descendre en bas ^^

  6. #6
    Expert éminent sénior

    Avatar de FirePrawn
    Homme Profil pro
    Consultant technique
    Inscrit en
    Mars 2011
    Messages
    3 179
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Consultant technique

    Informations forums :
    Inscription : Mars 2011
    Messages : 3 179
    Points : 19 373
    Points
    19 373
    Par défaut
    Tu testes sous quel navigateur et version de celui-ci ?

  7. #7
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    Je test sous google chrome, firefox et IE pour les versions j'utilise les dernières.

  8. #8
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    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
    #header {
    	position: relative; /* important */
    	background: #DDDDDD;
    	padding: 0 10px 0 0; 
    	background-image: url(header1.png);
    	height: 321px;
    }
    .maTable
    {
    	position:absolute; /* important */
    	bottom:0; /* important */
    }
    .maTable td
    {
    	text-align:center;
    }
    Avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <div id="header">
    	<table class="maTable" width="900" border="0" cellspacing="0" cellpadding="0">
    		<tr>
    			<td><a href="index.html">Accueil</a></td>
    			<td><a href="tarifs.html">Prestations et tarifs</a></td>
    			<td><a href="profil.html">Mon profil</a></td>
    			<td><a href="contact.html">Me contacter</a></td>
    		</tr>
    	</table>
    </div>

  9. #9
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    Un grand merci, c'est exactement ce que je voulais.
    Etant donné que je n'aime pas bêtement recopier ce qu'on m'a donné pourrais-je avoir une brève explication ?

    Sinon un résolu de plus pour vous

  10. #10
    Invité
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    #header {
    	position: relative; /* important */
    }
    - position: relative; -> Le conteneur doit être en position "relative"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    .maTable
    {
    	position:absolute; /* important */
    	bottom:0; /* important */
    }
    le contenu (qui doit être positionné en bas par rapport à ce conteneur) :
    - position:absolute; -> en position "absolue" (ne fonctionne que si le conteneur a le css : position:relative; )
    - bottom:0; -> "poser en bas" (distance par rapport au bas du conteneur = 0)

  11. #11
    Candidat au Club
    Homme Profil pro
    Aide infirmier
    Inscrit en
    Août 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Aide infirmier
    Secteur : Santé

    Informations forums :
    Inscription : Août 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    Merci c'est claire maintenant
    Bonne journée à tous !

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

Discussions similaires

  1. Réponses: 8
    Dernier message: 16/08/2010, 15h14
  2. Réponses: 6
    Dernier message: 16/06/2006, 13h22
  3. Obtenir le nom d'une table impliquée dans une contrainte
    Par graphicsxp dans le forum MS SQL Server
    Réponses: 3
    Dernier message: 18/01/2006, 18h19
  4. Réponses: 1
    Dernier message: 23/10/2005, 00h55
  5. Table vide dans une BD
    Par Riouxe21 dans le forum ASP
    Réponses: 2
    Dernier message: 06/07/2004, 19h48

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