Bonjour, je fais un TP et je voudrais centrer l'image de l'affiche du film, j'ai utiliser un "margin:auto" mais ça ne fonctionne pas, j'ai essayer avec "margin-left:..%" mais l'image ne bouge toujours pas..
Je vous montre un screen pour que vous compreniez mieux:
---------------------------------------------------------------------------------------
Et je mets également mon code:
Code :
- // Afficher du tableau
- echo "<table border='2' class='tableau'>";
- echo "<tr class='hauteur'>";
- echo "<th class='photo'>Photo du film</th>";
- echo "<th>Nom du film</th>";
- echo "<th class='description'>Description</th>";
- echo "<th>Genre</th>";
- echo "</tr>";
-
- // tant qu'il y a des lignes de retournées on affiche les films
- while ($line = mysql_fetch_array($result)) {
- /* la fonction mysql_fetch_array retourne les résultats sous la forme d'un tableau associatif dans lequel on accède aux différents éléments de la manière suivante
- */
- echo "<tr class='hauteur'>";
- echo "<td class='centre'><img src=images/".$line[photo]." width=80px height=50px></td>";
- echo "<td>".$line[titre]."</td>";
- echo "<td>".$line[resume]."</td>";
- echo "<td>".$titre[genre]."</td>";
- echo "</tr>";
- }
- echo "</table>";
|
----------------------------------------------------------------------------------------
Ma page CSS:
Code :
- body{
- background-image:url("images/accueil.jpg" );
- background-repeat:repeat;
- }
- .tableau{
- height:100px;
- width:80%;
- margin-left:10%;
- border-style:solid;
- }
- .hautimage{
- height:100px;
- }
- .hauteur{
- background-color:white;
- height:50px;
- }
- .description{
- width:33%;
- background-color:white;
- }
- .photo{
- width:100px;
- height:100%;
- }
- .centre{
- margin-left:5%;
- }
|