Ensuite remonte le <table> qui se trouve dans la boucle au dessus du <tr>
[EDIT]
Ah et le </table> dans la boucle déplace le en dessous du </tr>
<table>
<tr>
<td>
</td
</tr>
</table><table>
<tr>
<td>
</td
</tr>
</table>J'ai suivi ton conseil j'ai fait comme celaSupprime les deux balises <table> et </table> qui sont en dehors de la boucle
Ensuite remonte le <table> qui se trouve dans la boucle au dessus du <tr>
[EDIT]
Ah et le </table> dans la boucle déplace le en dessous du </tr>
<?php
$base = mysql_connect ('aaa','aaa','aaa');
mysql_select_db ('aaa, $base);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>petite annonce gratuite pour particulier encart publicitaire pour profesionnel - mon espace</title>
<meta http-equiv="Content-Type" content="text/html";
charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css"
title="Design espace" href="css/annonces_style.css" />
</head>
<body>
<div id="annonce"></div>
<div id="entete">
</div>
<div id="corps">
<img src="contenu/logisdesannonces.png" alt="logisdesannonces" class="logisdesannonces" />
<img src="contenu/logo.png" alt="logo" class="logo" />
<div id="bouton">
<a href="divers.html"><img src="contenu/divers.png" alt="divers" class="divers" border="0"/></a>
<a href="vehicule.html"><img src="contenu/vehicule.png" alt="vehicule" class="vehicule" border="0"/></a>
<a href="hightech.html"><img src="contenu/high-tech.png" alt="hightech" class="hightech" border="0"/></a>
<a href="immobilier.html"><img src="contenu/immobilier.png" alt="immobilier" class="immobilier" border="0"/></a>
<a href="animaux.html"><img src="contenu/animaux.png" alt="animaux" class="animaux" border="0"/></a>
<a href="espacepro.html"><img src="contenu/boutonpro.png" alt="bouton" class="bouton" border="0"/></a>
</div>
<a href="http://www.logisdesannonces.fr/accueil.html"><img src="contenu/bouton_accueil.png" alt="accueil" class="accueil" border="0"/></a>
</div>
<!-- Début du tableau -->
<?php
$sql= 'SELECT * FROM annonces WHERE 1';
$req= mysql_query($sql) or die ('erreur sql §<br />'.$sql.'<br />'.mysql_error());
//Ta boucle
$i=0;
while($data=mysql_fetch_array($req))
{ // ici la boucle qui permet d'effectuer la recherche
?>
<table>
<tr class="<?php echo ($i%2) ? 'classedufond2' : 'classedufond1'; ?>">
<td><?php echo $data ['departement']; ?></td>
<td><?php echo $data ['region']; ?></td>
<td><?php echo $data ['categorie']; ?></td>
<td><?php echo $data ['souscategorie']; ?></td>
<td><?php echo $data ['typeannonce']; ?></td>
<td><?php echo $data ['titreannonce']; ?></td>
<td><?php echo $data ['descriptionannonce']; ?></td>
<td><?php echo $data ['prix'].'<br /><br />'; ?></td>
</tr>
</table>
<?php
$i++;
?>
<?php
}
mysql_free_result ($req);
mysql_close ();
?>
</div>
<div id="pied_de_page">
<div id="boutonbas">
<a href="information.html"><img src="contenu/information.png" alt="information" class="information" border="0"/></a>
<a href="contact.html"><img src="contenu/contact.png" alt="contact" class="contact" border="0"/></a>
<a href="newsletters.html"><img src="contenu/newsletters.png" alt="newsletters" class="newsletters" border="0"/></a>
<a href="offre.html"><img src="contenu/offre.png" alt="offre" class="offre" border="0"/></a>
<a href="aide.html"><img src="contenu/aide.png" alt="aide" class="aide" border="0"/></a>
</div>
</div>
</body>
</html>
mais cela ne change rien <?php
$base = mysql_connect ('zzzz,'zzzz','zzzz');
mysql_select_db ('zzzz', $base);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>petite annonce gratuite pour particulier encart publicitaire pour profesionnel - mon espace</title>
<meta http-equiv="Content-Type" content="text/html";
charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css"
title="Design espace" href="css/annonces2_style.css" />
</head>
<body>
<div id="annonce"></div>
<div id="entete">
</div>
<div id="corps">
<img src="contenu/logisdesannonces.png" alt="logisdesannonces" class="logisdesannonces" />
<img src="contenu/logo.png" alt="logo" class="logo" />
<div id="bouton">
<a href="divers.html"><img src="contenu/divers.png" alt="divers" class="divers" border="0"/></a>
<a href="vehicule.html"><img src="contenu/vehicule.png" alt="vehicule" class="vehicule" border="0"/></a>
<a href="hightech.html"><img src="contenu/high-tech.png" alt="hightech" class="hightech" border="0"/></a>
<a href="immobilier.html"><img src="contenu/immobilier.png" alt="immobilier" class="immobilier" border="0"/></a>
<a href="animaux.html"><img src="contenu/animaux.png" alt="animaux" class="animaux" border="0"/></a>
<a href="espacepro.html"><img src="contenu/boutonpro.png" alt="bouton" class="bouton" border="0"/></a>
</div>
<a href="http://www.logisdesannonces.fr/accueil.html"><img src="contenu/bouton_accueil.png" alt="accueil" class="accueil" border="0"/></a>
</div>
<!-- Début du tableau -->
<?php
$sql= 'SELECT * FROM annonces WHERE 1';
$req= mysql_query($sql) or die ('erreur sql §<br />'.$sql.'<br />'.mysql_error());
//Ta boucle
$i=0;
while($data=mysql_fetch_array($req))
{ // ici la boucle qui permet d'effectuer la recherche
?>
<div id="tableau">
<table>
<tr>
<th colspan="3"><?php echo $data ['titreannonce']; ?></th>
<th>DATE </th>
</tr>
<tr>
<td colspan="3"><?php echo $data ['region']; ?></td>
<td><?php echo $data ['prix']; ?></td>
</tr>
<tr>
<td colspan="4"><?php echo $data ['descriptionannonce']; ?></td>
</tr>
</table>
</div>
<?php
}
mysql_free_result ($req);
mysql_close ();
?>
</div>
<div id="pied_de_page">
<div id="boutonbas">
<a href="information.html"><img src="contenu/information.png" alt="information" class="information" border="0"/></a>
<a href="contact.html"><img src="contenu/contact.png" alt="contact" class="contact" border="0"/></a>
<a href="newsletters.html"><img src="contenu/newsletters.png" alt="newsletters" class="newsletters" border="0"/></a>
<a href="offre.html"><img src="contenu/offre.png" alt="offre" class="offre" border="0"/></a>
<a href="aide.html"><img src="contenu/aide.png" alt="aide" class="aide" border="0"/></a>
</div>
</div>
</body>
</html>
et voici mon code CSS.Code : Tout sélectionner
body
{
color: black;
background-color: #CBCBCB;
}
#entete
{
width: 1024px;
height: 200px;
position: absolute;
top: 90px;
left: 90px;
background: url("../contenu/barre.png") no-repeat;
}
div#entete
{
color:white;
font-size:15px;
font-family: arial;
}
#h2
{
position: absolute;
top: 100px;
left: 200px;
font-size:13px;
font-family: arial;
color:white;
}
.logisdesannonces
{
position: absolute;
top: 30px;
left: 210px;
}
.accueil
{
position: absolute;
top: 79px;
left: 100px;
}
.logo
{
position: absolute;
top: -20px;
left: 90px;
}
#bouton
{
width: 1024px;
height: 200px;
position: absolute;
top: 0px;
left: 160px;
border: 0px;
}
.divers
{
position: absolute;
top: 79px;
left: 102px;
border: 0px;
}
.vehicule
{
position: absolute;
top: 79px;
left: 240px;
border: 0px;
}
.hightech
{
position: absolute;
top: 79px;
left: 378px;
border: 0px;
}
.immobilier
{
position: absolute;
top: 79px;
left: 516px;
border: 0px;
}
.animaux
{
position: absolute;
top: 79px;
left: 654px;
border: 0px;
}
.bouton
{
position: absolute;
top: 30px;
left: 580px;
border: 0px;
}
#tableau
{
top: 150px;
left: 0px;
position: relative;
font-size: 12px;
font-family: arial;
}
table
{
height: 100px ;
width: 495px ;
position: relative;
border: 1.5px solid black;
border-collapse: collapse;
margin: 10px;
background: url("../contenu/petite_annonce.png") no-repeat;
}
td
{
border: 0px;
border-collapse: collapse;
}
th
{
border: 1.5px dotted black;
border-collapse: collapse;
}
#pied_de_page
{
width: 1024px;
height: 200px;
position: absolute;
top: 780px;
left: 90px;
background: url("../contenu/barre.png") no-repeat;
}
#boutonbas
{
width: 1024px;
height: 200px;
position: absolute;
top: 0px;
left: 160px;
border: 0px;
}
.information
{
position: absolute;
top: -10px;
left: 10px;
border: 0px;
}
.contact
{
position: absolute;
top: -10px;
left: 150px;
border: 0px;
}
.offre
{
position: absolute;
top: -10px;
left: 290px;
border: 0px;
}
.newsletters
{
position: absolute;
top: -10px;
left: 430px;
border: 0px;
}
.aide
{
position: absolute;
top: -10px;
left: 570px;
border: 0px;
}
style="width:400px; height:200px;"
C'est aussi souvent plus simple à la création de la page, tu as ainsi qu'un seul fichier a modifier et a tester...<div id="annonces">
Ensuite dans ton css:
Code : Tout sélectionner
div#annonces table {
width:400px;
height:200px;
}Code : Tout sélectionner
.prix {
width:50px;
height:50px;
}
.description {
width:100px;
height:100px;
}<td class="description" colspan="4"><?php echo $data ['descriptionannonce']; ?></td>
Sinon:<td style="width:50px; height:50px;">prix</td>
_______________Code : Tout sélectionner
div#annonces table {
width:400px;
height:200px;
}<div id="annonces">
// ta boucle
</div>
De cette façon, il n'y aura que les tableaux de tes annonces qui seront pris en compte.<?php
$base = mysql_connect ('zzzzz','zzzzz','zzz');
mysql_select_db ('zzzzz', $base);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>petite annonce gratuite pour particulier encart publicitaire pour profesionnel - mon espace</title>
<meta http-equiv="Content-Type" content="text/html";
charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css"
title="Design espace" href="css/annonces3_style.css" />
</head>
<body>
<div id="annonce"></div>
<div id="entete">
</div>
<div id="corps">
<img src="contenu/logisdesannonces.png" alt="logisdesannonces" class="logisdesannonces" />
<img src="contenu/logo.png" alt="logo" class="logo" />
<div id="bouton">
<a href="divers.html"><img src="contenu/divers.png" alt="divers" class="divers" border="0"/></a>
<a href="vehicule.html"><img src="contenu/vehicule.png" alt="vehicule" class="vehicule" border="0"/></a>
<a href="hightech.html"><img src="contenu/high-tech.png" alt="hightech" class="hightech" border="0"/></a>
<a href="immobilier.html"><img src="contenu/immobilier.png" alt="immobilier" class="immobilier" border="0"/></a>
<a href="animaux.html"><img src="contenu/animaux.png" alt="animaux" class="animaux" border="0"/></a>
<a href="espacepro.html"><img src="contenu/boutonpro.png" alt="bouton" class="bouton" border="0"/></a>
</div>
<a href="http://www.logisdesannonces.fr/accueil.html"><img src="contenu/bouton_accueil.png" alt="accueil" class="accueil" border="0"/></a>
</div>
<!-- Début du tableau -->
<?php
$sql= 'SELECT * FROM annonces WHERE 1';
$req= mysql_query($sql) or die ('erreur sql §<br />'.$sql.'<br />'.mysql_error());
//Ta boucle
$i=0;
while($data=mysql_fetch_array($req))
{ // ici la boucle qui permet d'effectuer la recherche
?>
<table>
<tr>
<td class="titreannonce"><?php echo $data ['titreannonce']; ?></td>
<td class="date">DATE </th>
</tr>
<tr>
<td class="region"><?php echo $data ['region']; ?></td>
<td class="prix"><?php echo $data ['prix']; ?></td>
</tr>
<tr>
<td class="description" colspan="2"><?php echo $data ['descriptionannonce']; ?></td>
</tr>
<tr>
<td class="vide"></td>
<td class="pseudo"><?php echo $data ['pseudo']; ?></td>
</tr>
</table>
<?php
}
mysql_free_result ($req);
mysql_close ();
?>
</div>
<div id="pied_de_page">
<div id="boutonbas">
<a href="information.html"><img src="contenu/information.png" alt="information" class="information" border="0"/></a>
<a href="contact.html"><img src="contenu/contact.png" alt="contact" class="contact" border="0"/></a>
<a href="newsletters.html"><img src="contenu/newsletters.png" alt="newsletters" class="newsletters" border="0"/></a>
<a href="offre.html"><img src="contenu/offre.png" alt="offre" class="offre" border="0"/></a>
<a href="aide.html"><img src="contenu/aide.png" alt="aide" class="aide" border="0"/></a>
</div>
</div>
</body>
</html>
et voici mon code CSS.Code : Tout sélectionner
body
{
color: black;
background-color: #CBCBCB;
}
#entete
{
width: 1024px;
height: 200px;
position: absolute;
top: 90px;
left: 90px;
background: url("../contenu/barre.png") no-repeat;
}
div#entete
{
color:white;
font-size:15px;
font-family: arial;
}
#h2
{
position: absolute;
top: 100px;
left: 200px;
font-size:13px;
font-family: arial;
color:white;
}
.logisdesannonces
{
position: absolute;
top: 30px;
left: 210px;
}
.accueil
{
position: absolute;
top: 79px;
left: 100px;
}
.logo
{
position: absolute;
top: -20px;
left: 90px;
}
#bouton
{
width: 1024px;
height: 200px;
position: absolute;
top: 0px;
left: 160px;
border: 0px;
}
.divers
{
position: absolute;
top: 79px;
left: 102px;
border: 0px;
}
.vehicule
{
position: absolute;
top: 79px;
left: 240px;
border: 0px;
}
.hightech
{
position: absolute;
top: 79px;
left: 378px;
border: 0px;
}
.immobilier
{
position: absolute;
top: 79px;
left: 516px;
border: 0px;
}
.animaux
{
position: absolute;
top: 79px;
left: 654px;
border: 0px;
}
.bouton
{
position: absolute;
top: 30px;
left: 580px;
border: 0px;
}
table
{
position: relative;
top: 100px;
left: 100px;
border: 1.5px solid black;
border-collapse: collapse;
margin: 10px;
}
.titreannonce {
width:300px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
font-size:16px;
font-family: arial;
color:white;
}
.date {
width:80px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
}
.region {
width:300px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
}
.prix {
width:80px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
}
.description {
width:380px;
height:100px;
border: 1.5px solid white;
border-collapse: collapse;
}
.vide {
width:300px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
}
.pseudo {
width:80px;
height:20px;
border: 1.5px solid white;
border-collapse: collapse;
}
#pied_de_page
{
width: 1024px;
height: 200px;
position: absolute;
top: 780px;
left: 90px;
background: url("../contenu/barre.png") no-repeat;
}
#boutonbas
{
width: 1024px;
height: 200px;
position: absolute;
top: 0px;
left: 160px;
border: 0px;
}
.information
{
position: absolute;
top: -10px;
left: 10px;
border: 0px;
}
.contact
{
position: absolute;
top: -10px;
left: 150px;
border: 0px;
}
.offre
{
position: absolute;
top: -10px;
left: 290px;
border: 0px;
}
.newsletters
{
position: absolute;
top: -10px;
left: 430px;
border: 0px;
}
.aide
{
position: absolute;
top: -10px;
left: 570px;
border: 0px;
}