Bonjour
Ceci devrait vous aider:
<table width="100%">
<tr>
<?php if ($this->_tpl_vars'records']):
$i = 0; ?>
<div class="subhead1"><?= @INDEX_FEATURED; ?></div>
<?php $_from = $this->_tpl_vars'records']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
foreach ($_from as $this->_tpl_vars'image']): ?>
<?php if ($this->_tpl_vars'use_fancy_urls']): ?>
<td><a href="listings/view/<?= ((is_array($_tmp=$this->_tpl_vars'image']'departement'])) ? $this->_run_mod_handler('strip', true, $_tmp, "-") : smarty_modifier_strip($_tmp, "-")); ?>/<?= ((is_array($_tmp=$this->_tpl_vars'image']'model'])) ? $this->_run_mod_handler('strip', true, $_tmp, "-") : smarty_modifier_strip($_tmp, "-")); ?>
/<?= $this->_tpl_vars'image']'listingid']; ?>/"><img src="<?= $this->_tpl_vars'image']'imagethumbpath']; ?>" title="<?= $this->_tpl_vars'image']'ad_title']; ?>" alt="<?= $this->_tpl_vars'image']'ad_title']; ?>" /></a>
<?php else: ?>
<td><a href="listings.php?departement=<?= ((is_array($_tmp=$this->_tpl_vars'image']'departement'])) ? $this->_run_mod_handler('strip', true, $_tmp, "-") : smarty_modifier_strip($_tmp, "-")); ?>&model=<?= ((is_array($_tmp=$this->_tpl_vars'image']'model'])) ? $this->_run_mod_handler('strip', true, $_tmp, "-") : smarty_modifier_strip($_tmp, "-")); ?>
&id=<?= $this->_tpl_vars'image']'listingid']; ?>"><img src="<?= $this->_tpl_vars'image']'imagethumbpath']; ?>
" title="<?= $this->_tpl_vars'image']'ad_title']; ?><?= $this->_tpl_vars'image']'villes']; ?> dans le département <?= $this->_tpl_vars'image']'departement']; ?>
" alt="<?= $this->_tpl_vars'image']'ad_title']; ?><?= $this->_tpl_vars'image']'villes']; ?> dans le département <?= $this->_tpl_vars'image']'departement']; ?>
" />
<?php endif; ?>
<br /><div class="subhead0" align="center"><?= $this->_tpl_vars'image']'ad_title']; ?></div><br /></a></td>
$i++;
<?php
if(($i % 4) == 0)
echo "</tr><tr>";
?>
<?php endforeach; endif; unset($_from); ?>
</tr>
</table>
J'ai appliquer ce que vous a dit maximeshr en ajoutant des ligne à votre tableau "<tr></tr>"
De plus à la ligne 27, je fais un test pour savoir si nous avons 4 annonces, si oui, je termine ma ligne et en commence une autre, sinon je continue.