Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Pb de tableau et de boucle

1 réponse
Avatar
SuperG2
Bonjour les pros, J'ai fais la boucle suivante, mais j'ai un problème
d'affichage.
En effet, les tables se mettent l'une au dessous de l'autre ...
Or moi, je voudrais 3 colonnes puis un retour chariot.

Je ne vois pas comment faire :-/

De plus je devrais utiliser rand() par la suite, mais ça, c'est un détail.
Aidez moi svp.

Bernard


while($row = mysql_fetch_array($result)) {

echo '<table border="0" cellpadding="0" cellspacing="0">';
echo '<tr><td><img src="images/t_11.gif" width="10" height="9" alt=""
border="0"></td>';
echo '<td background="images/t_13.gif"><img src="images/t_12.gif" width="6"
height="9" alt="" border="0"></td>';
echo '<td background="images/t_13.gif" align="right"><img
src="images/t_14.gif" width="6" height="9" alt="" border="0"></td>';
echo '<td><img src="images/t_15.gif" width="10" height="9" alt=""
border="0"></td>';
echo '</tr><tr valign="top"><td background="images/t_fon_left.gif"><img
src="images/t_21.gif" width="10" height="6" alt="" border="0"></td>';
echo '<td rowspan="2" colspan="2"><!-- in --><table border="0"
cellpadding="0" cellspacing="0" width="160"><tr>';
echo '<td><img src="images/mini.gif" alt="" width="58" height="88"
border="0"></td><td>';
echo '<p style="color: #1F86DE; font-size: 11px; padding-bottom: 0px;
margin-left:10px;
margin-right:0px;"><strong>'.$row["DescriptifAdVille"].'</strong></p>';
echo '<p style="color: #000000; font-size: 11px; padding-bottom: 0px;
margin-left:10px;">Code :'.$row["DescriptifRefCode"].'<br/>';
echo 'Superficie : '.$row["DescriptifCaraSurface"].'<br/>Prix
:'.$row["DescriptifCaraPrixMoyen"].'</p>';
echo '<p align="right" style="color: #DA0008; font-size: 10px;
margin-right:10px;"><b>d&eacute;tail ...</b></p>';
echo '</td></tr></table><!-- /in --></td>';
echo '<td background="images/t_fon_right.gif"><img src="images/t_23.gif"
width="10" height="6" alt="" border="0"></td>';
echo '</tr><tr valign="bottom"><td background="images/t_fon_left.gif"><img
src="images/t_31.gif" width="10" height="7" alt="" border="0"></td>';
echo '<td background="images/t_fon_right.gif"><img src="images/t_33.gif"
width="10" height="7" alt="" border="0"></td></tr>';
echo '<tr><td><img src="images/t_41.gif" width="10" height="10" alt=""
border="0"></td>';
echo '<td background="images/t_fon_bot.gif"><img src="images/t_42.gif"
width="6" height="10" alt="" border="0"></td>';
echo '<td background="images/t_fon_bot.gif" align="right"><img
src="images/t_44.gif" width="6" height="10" alt="" border="0"></td>';
echo '<td ><img src="images/t_45.gif" width="10" height="10" alt=""
border="0"></td></tr>';
echo '</table>';

1 réponse

Avatar
afriqs
SuperG2 wrote:

Bonjour Bernard,

C'est normal que tu aies dees tableaux et pas des colonnes. En HTML, une
table est ce qui se situe entre <table> et </table>. Or tu as des
</table> incorporés dans ton code alors que tu devrais n'en avoir qu'un
à la fin.

pour faire simple:
<table> et </table> délimient un tableau
<tr> et </tr> délimitent une ligne
<td> et </td> délimitent une cellule

Soit par exemple :

<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>

représente un tableau à deux lignes et trois colonnes.

HIH

--
@lex
MacPro
iBook Dual 600 MHz
Mac OS X v10.4