|
|
Voir le sujet précédent :: Voir le sujet suivant |
Auteur |
Message |
cognin frontpage mioche
|
pb mise en page tableaux , Posté le: 10-02-2005 17:46 |
|
|
Bonjour à tous
Cela fait un moment que je galère avec ces tableaux faits à partir d'une bdd. Voilà comment cela devrait être http://lindamuzard.chez.tiscali.fr//test%20tableaux.htm (fait à la main) et voici comment c'est http://lindamuzard.chez.tiscali.fr//test10.htm avec la bdd et le code suivant :
Code: |
// on choisit les AR_CATA
$sql3="SELECT DISTINCT AR_CATA, AR_TYPE FROM articles";
$valeur=mysql_query($sql3,$db);
echo "\t<table border='1' cellpadding='0' cellspacing='0' width='100%'>\r\n";
echo "\t<TR>\r\n";
while($row_val = mysql_fetch_array($valeur))
{
// $cata prend successivement les valeurs AR_CATA
$cata = $row_val["AR_CATA"];
$indqte = 1;
echo "\t<td width='25%' name='cell'>\r\n";
echo "<table width='100%' border='1' cellpadding='0' cellspacing='0'>\r\n";
echo "\t<TR>\r\n";
// affichage du type AR_TYPE et de l'image du transfert
echo "\t<td height='40' nowrap colspan='5' class='dim'><div align='center'><p>".$row_val["AR_TYPE"]."</p></div></td>\r\n";
echo "\t</tr>\r\n";
echo "\t<TR>\r\n";
echo "\t<td height='160' nowrap colspan= '5' class='image'><img src='../_gif/".$row_val["AR_CATA"].".gif' width='130' height='119'></td>\r\n";
echo "\t</tr>\r\n";
echo "\t<TR>\r\n";
// requete pour recuperer toutes les infos de tous les produits en fonction de leur AR_CATA
$sql2="SELECT * FROM articles WHERE AR_CATA=$cata";
$result2=mysql_query($sql2,$db);
//----- Descriptif du produit en fonction de son AR_CATA --------------------------------------------------------------------------------
echo "\t<td height='12' nowrap class='dim' readonly=''>Article No.</td>\r\n";
echo "\t<td height='12' nowrap class='dim'>Size in cm</td>\r\n";
echo "\t<td height='12' nowrap class='dim'>Size in inch</td>\r\n";
echo "\t<td height='12' nowrap class='prixtitre' readonly=''>Price</td>\r\n";
echo "\t<td height='12' nowrap class='qte'>Qty</td>\r\n";
echo "\t</tr>\r\n";
$ligne = 1;
while (($row2 = mysql_fetch_array($result2)) || ($ligne<4)) {
echo "\t<TR>\r\n";
echo "\t<td height='12' nowrap class='ref' size='5' maxlength='9' readonly=''>".$row2["AR_CODE"]."</td>\r\n";
echo "\t<TD nowrap class='dim'>".$row2["AR_CM"]."</TD>\r\n";
echo "\t<TD nowrap class='dim'>".$row2["AR_POUCES"]."</TD>\r\n";
echo "\t<TD nowrap class='prix' size='4' maxlength='4' readonly=''>".$row2["AR_PRIX"]."</TD>\r\n";
echo "\t<td nowrap> <input name='qte".$indqte."' type='text' class='qte' size='2' maxlength='4' value=''></td>\r\n";
echo "\t </tr>\r\n";
$ligne++;
}
if($cell>=4){
echo "\t</table>\r\n";
echo "\t</td>\r\n";
echo "\t</tr>\r\n";
echo "\t</table>\r\n";
echo "\t<tr>\r\n";
}
echo "\t</table>\r\n";
echo "\t</td>\r\n";
}
echo "\t</tr>\r\n";
echo "\t</table>\r\n";
?> |
J'arrive pas à faire l'interligne après le 4ème élément, c'est à dire il doit me mettre les tableaux 4 par 4 tant qu'il y en a.., le tableau principal ne sert qu'à la mise en forme.
Désespérée je vous dis merci de votre aide. |
|
|
iowa php mioche
|
pb mise en page tableaux , Posté le: 11-02-2005 11:35 |
|
|
fais plutot une boucle while pour lister tout ce que contient ta table |
|
|
cognin frontpage mioche
|
pb mise en page tableaux , Posté le: 15-02-2005 15:59 |
|
|
:?Merci de ta réponse. Il me sort bien tout sans pb. Il s'agit juste de la mise en page qui n'est pas correct.
@+ |
|
|
|
|
Accueil Forum
-> php |
Toutes les heures sont au format GMT + 1 Heure
|
Page 1 sur 1 |
|
S'enregistrer
Profil
Se connecter pour vérifier ses messages privés
Rechercher
Membres
FAQ
Connexion
|