Aligner un tableau

Ecux Messages postés 4 Date d'inscription mercredi 9 décembre 2009 Statut Membre Dernière intervention 4 octobre 2010 - 30 sept. 2010 à 13:26
Ecux Messages postés 4 Date d'inscription mercredi 9 décembre 2009 Statut Membre Dernière intervention 4 octobre 2010 - 4 oct. 2010 à 18:58
Bonjour,

je cherche depuis ce matin comment aligner un tableau horizontalement.
Normalement si il est contenu dans une div dont le text-align vaut center ça devrait marcher mais là non. Je comprends pas ce que j'ai oublié :'(

voici mon css
#content                 { margin:10px; text-align:center;}
#content h1              { margin:10px 0px; font-size:16pt; font-weight:bold; }
#content h2              { margin-bottom:5px; font-size:14pt; }
#content h4              { margin-bottom:5px; font-size:14pt;font-weight:200 ;}
#content form            { margin:10px;text-align:right; }
#content br              { clear:both; }
#content hr              { width:500px; margin:5px 0px; border:1px dashed; }
#content .form           { clear:both; width:600px;}
#content .form_import           { padding-left: 15px; padding-right: 15px; clear:both; width:100%; }
#content .frame          { float:left; margin:5px 0px; border:1px inset; }
#content .form h3        { margin:5px 0px; text-align:center; font-weight:bold; }
#content .form span      { margin:1px 0px; }
#content input.text      { border-width:1px; width:250px; }
#content select          { border-width:1px; }
#content table           { border:2px solid ; border-collapse:collapse;}
#content th              { font-weight:bold; white-space:nowrap;}
#content th, #content td { border:1px solid;/*text-align: center;*/ padding:5px; }
#content td              {white-space:nowrap;}
#content p               { margin:20px; }
#content .stats { float:left; margin: 15px; border-color: black; border-width: 1px; }
#content .stats th{ text-align: left; border-color: black; border-width: 1px; }
#content .stats td{ text-align: right; border-color: black; border-width: 1px; }
#content .stats .stats_out { text-align:left; border-color: black; border-width: 1px; }
#content a { text-decoration:none; color:#191970; }
#content a:hover { color:white; }
#content .boutton { display: block; padding: 5px 5px 5px 5px; width: 200px; background-color: #DDDDDD; border-width: 1px; border-style: solid; border-color: #999999; font-style: arial;  font-weight:bold; color: #333333; cursor:pointer; }
#content  .boutton:hover { color: #000080; background-color: #AAAAAA; border-color: #000000; }
#content #search { width:600px; border-color: black; padding: 10px;}
#content #search table , #content #search table td { border: 0px; }
#content ol, #content ul { margin:20px; list-style-position:inside; }
#content .bpopup { font-family: Times New Roman, Times, serif; color:#191970; background-color:#DDDDDD; cursor:pointer;}
#content .bpopup:hover { color:white; }



Voici ma page hmtl :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title>Extranet Inescom - ADMIN - Gestion des utilisateurs</title>
        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
        <link href="../css/style.css" rel="stylesheet" type="text/css">
        <script src="../js/script.js" type="text/javascript"></script>
        
    </head>




        [../ ]
        
<li class="selected">
                        [?part=user >> Utilisateurs <<]
                    </li><li class="fleft">
                        [?part=salaries Infos Salariés]
                    </li><li class="fleft">

                        [?part=indeps Infos Indépendants]
                    </li><li class="fleft">
                        [?part=societes Sociétés]
                    </li><li class="fleft">
                        [?part=clients Infos Clients]
                    </li><li class="fleft">
                        [?part=consignes Consignes]

                    </li><li class="fleft">
                        [?part=docs Documents]
                    </li><li class="fright">
                        [?part=quit Déconnexion]
                    </li>

                <form method="post" enctype="multipart/form-data" action="">Gestion des utilisateurs
[javascript:form_submit('action','new') 
                    Ajouter un nouvel utisisateur
                ]

test css

Login |Mot de passe |Profil |
Actions |
----

rachid, mot, Administrateur,

,
----

c1, c, Client,

,
----

chef1, c, Chef d'équipe,

,
----

eva, riste, Administrateur,

,
----

Page :1



            
            
            
        
</form>

</html>


Je précise que j'ai rajouté le
exprès pour tester et c'est génial le texte "test css" est bien centré mais mon tableau non. Ce n'est donc pas un problème de id ou de class... je pète un cable quoi :)
Ca doit etre un truc balo ou une ignorance de ma part sur CSS. Bref si quelqu'un peut me fournir une explication/solution. Merci

3 réponses

Lyle56 Messages postés 240 Date d'inscription jeudi 1 mai 2008 Statut Membre Dernière intervention 19 juillet 2012 2
1 oct. 2010 à 10:59
Bonjour,

su ton div qui contient le tableau essai :

margin : 0 auto;



Sans maitrise, la puissance n'est rien
Il ne faut pas vendre la peau de l'ours, non il ne faut pas.
0
DiabloBros Messages postés 25 Date d'inscription mardi 24 octobre 2006 Statut Membre Dernière intervention 12 novembre 2010
3 oct. 2010 à 23:46
<style>
        td.center { text-align:center 	}
</style>


lol




DiabloBros Was Here...
0
Ecux Messages postés 4 Date d'inscription mercredi 9 décembre 2009 Statut Membre Dernière intervention 4 octobre 2010
4 oct. 2010 à 18:58
Merci de vos réponses. La seule solution que j'ai trouvé est un
avec ma table dedans. Les margin et text-align:center en CSS n'aligne que du texte, pas l'élément <table> . Merci quand même de vos réponses.

Donc j'ai le résultat que je voulais mais en CSS je sais toujours pas si c'est possible d'obtenir la même chose.
0
Rejoignez-nous