mise en forme dans un tableau de fichier php
Bonjour
J'ai petit probleme.Sur mon site j'affiche des images + texte de personne que j'ai uploadé via un formulaire.
Le probleme est lors de l'affichage qui est sous forme de tableau j'ai la photo et le texte en dessous. Je voudrai que le texte soit à droite.
Apres plusieurs tentative aucun succes.
Voici mon script :
Code:
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
| <tr>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['nom'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['xxx'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['xxx'];?></td>
<td width="100" align="center" valign="top" bgcolor="#DCDCDC"><?php echo $tableau['xxx'];?></td>
</tr>
<tr>
<td width="100%" colspan="4" align="center" valign="top">
<?php
$destination = $tableau['photo']; //destination des images
$dimensions = @getimagesize($destination);
if($dimensions[0]<=120 && $dimensions[1]<=120) //si la longueur et inférieure ou égale à 120 de même pour la largeur
{
echo'<img src="'.$tableau['photo'].' " alt="image" />';
}
else
{
echo'<img src="'.$tableau['photo'].' " alt="image" style="width:auto; height:100px;"/>';
}
?>
</td>
</tr>
<td width="100%" colspan="4" align="left" valign="top"><?php echo $tableau['texte'];?></td>
</tr>
<tr>
<td colspan="4">----------------------------------------------------------------------------------</td>
</tr> |
Pouvez vous m'aider.
MERCI