afficher vignette dans un tableau ?
Posté : 17 juil. 2007, 20:56
Bonjour à tous,
Mon site fonctionne mais maintenant je souhaiterai l'améliorer.
Le code ci dessous me permet d'afficher mes vignettes en 3 colonnes sur 3 lignes.
Mais quand je n'ai que 2 photos (par exemple) les vignettes s'affichent en 1 seule ligne mais en plein milieu du cadre et séparée par un espace.
Or j'aimerai que ces vignettes soient collés en haut à gauche jusqu'à 3, puis descendent d'une ligne et recommencent l'affichage jusqu'à 3, puis redescendent d'une ligne, etc....
J'ai donc pensé créer un tableau de 3 colonnes et 3 lignes afin qu'elles soient calées, mais là malgré ma recherche dans ce forum, je ne sais pas comment faire.
encore merci pour votre aide
Nicolas
Mon site fonctionne mais maintenant je souhaiterai l'améliorer.
Le code ci dessous me permet d'afficher mes vignettes en 3 colonnes sur 3 lignes.
Mais quand je n'ai que 2 photos (par exemple) les vignettes s'affichent en 1 seule ligne mais en plein milieu du cadre et séparée par un espace.
Or j'aimerai que ces vignettes soient collés en haut à gauche jusqu'à 3, puis descendent d'une ligne et recommencent l'affichage jusqu'à 3, puis redescendent d'une ligne, etc....
J'ai donc pensé créer un tableau de 3 colonnes et 3 lignes afin qu'elles soient calées, mais là malgré ma recherche dans ce forum, je ne sais pas comment faire.
encore merci pour votre aide
Nicolas
<?php
$idstruc = $_GET['idstruc'];
if (idstruc =="") {
$query_rsmac = "SELECT * FROM `structure` LIMIT 0 , 12 where noms='choc' order by idstruc";
}
else
{
$query_rsmac = "SELECT * FROM `structure` where noms='choc' and idstruc>='$idstruc' order by idstruc";}
$rsmac = mysql_query($query_rsmac, $Califeliste) or die(mysql_error());
$row_rsmac = mysql_fetch_assoc($rsmac);
$totalRows_rsmac = mysql_num_rows($rsmac);
?>
<html>
<head>
</head>
<body>
<table width="370" height="435" border="0" cellpadding="0" cellspacing="0">
<tr><td width="370" height="115"> </td></tr>
<tr><td width="370" height="300" align="left" valign="top">
<table width="360" height="300" border="0" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td width="120" height="100">
<a href="javascript:popUp('pop.php?idstruc=<?php echo $row_rsmac['idstruc']; ?>');">
<img width="120" src="../../administ/images/<?php echo $row_rsmac['photos']; ?>" border="0" height="90" alternative="test"></a></td>
<?
$prec=$row_rsmac['idstruc'];
$x=0;
while ($row_rsmac = mysql_fetch_array($rsmac)) {
$x++;
if ($x==1) {
if($_GET['borne']<>"") {$borne=$_GET['borne'];}else{$borne=0;}
}
if ($x<=8) { ?>
<td width="120" height="100">
<a href="javascript:popUp('pop.php?idstruc=<?php echo $row_rsmac['idstruc']; ?>');">
<img width="120" src="../../administ/images/<?php echo $row_rsmac['photos']; ?>" border="0" height="90" ></a></td> <?
if ($x==2 or $x==5) {?></tr><?}
$suiv=$row_rsmac['idstruc'];
}
}?>
</table></td></tr>
<tr><td width="370" height="20" align="left">
<table width="360" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td width="40" height="20">
<a href="chocolat.php?idstruc=<? echo $_GET['prec'] ?>">
<img src="../div_phot/flechegch.jpg" width="35" height="20" border="0"></a></td>
<td width="135" height="20" align="left" valign="middle" class="blanc12">précédents</td>
<td width="135" height="20" align="right" valign="middle" class="blanc12">suivants </td>
<td width="40" height="20" align="right">
<a href="chocolat.php?idstruc=<? echo $suiv ?>&prec=<? echo $prec ?>">
<img src="../div_phot/flechdrt.jpg" width="35" height="20" border="0"></a></td>
</tr></table></td></tr></table>
</body>
</html>