j'utilise une boucle php pour générer une liste d'items (texte + image) à partir de données sql.
Mon problème est le html généré. J'essaye d'obtenir quelquechose d'uniforme mais ça ne marche pas.
Mes tableaux html ont des tailles différentes en fonction de la longueur du texte, que je n'arrive pas à rendre fixe.
Voyez vous d'ou ça peut venir?
Pour voir le pb:
Cliquez ici
Mon html (dans une boucle, pour générer autant de tableaux qu'il y a d'items):
<table width="100%" border="0" cellpadding="3" cellspacing="0" >
<tr><td align='center'>
<?php
foreach ($elts as $elt)
{
?>
<table border='0' cellpadding='0' width='300' cellspacing='10' style='border: solid 1px #eaeaea; border-collapse:collapse;'>
<tr>
<td align='left'><span style='font-size: 15px; font-weight: bold;'>{titre}</span></td>
<td align='right' width='10%'>
<a href='{url}'>
<img src='images/stories/teambuilding_thumbs/{image}' style='border: solid 1px #eaeaea;'></a></td>
</tr>
<tr>
<td colspan='2' height='60' valign='top'>{texte_intro}</td>
</tr>
<tr>
<td colspan='2' height='10'>
<a href='{url}' class='readon'>Read more...</a></td>
</tr>
</table>
if ($i%2 == 0)
{
echo "</td></tr><tr><td>";
}
else
{
echo "</td><td>";
}
$i++;
}
</td></tr>
</table>
<?php
}
?>
Merci pour vos réponses.