<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" xml:lang="fr" />
<title>Infobulles</title>
<script type="text/javascript">
/* <![CDATA[ */
function $(elt)
{
return document.getElementById(elt);
}
function affichermasquer(idbloc)
{
var etat = $(idbloc).style.display;
$(idbloc).style.display = (etat == 'none') ? 'block' : 'none';
}
/* ]]> */
</script>
<style type="text/css">
/* <![CDATA[ */
div.blocinfo {
position: relative;
}
div.blocinfo p {
z-index: 10;
}
div.blocinfo table {
position: absolute;
top: 25px;
left: 0px;
border: 1px solid #ccc;
z-index: 20;
color: #000;
background-color: #efefef;
border-collapse: collapse;
}
div.blocinfo table td {
border: 1px solid #ccc;
}
/* ]]> */
</style>
</head>
<body>
<table summary="">
<tr>
<td>
<p>Ligne 1</p>
</td>
<td>
<p>Titre quelconque 1</p>
</td>
<td>
<div id="blocinfo0" class="blocinfo">
<p><a href="./" title="Afficher les détails" onmouseover="affichermasquer('tableinfos0');" onmouseout="affichermasquer('tableinfos0');">Détails</a></p>
<table id="tableinfos0" summary="" style="display: none">
<tr>
<td>Info 0</td>
<td>Seconde info 0</td>
<td>Troisieme info 0</td>
<td>Dernière info 0</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<p>Ligne 2</p>
</td>
<td>
<p>Titre quelconque 2</p>
</td>
<td>
<div id="blocinfo1" class="blocinfo">
<p><a href="./" title="Afficher les détails" onmouseover="affichermasquer('tableinfos1');" onmouseout="affichermasquer('tableinfos1');">Détails</a></p>
<table id="tableinfos1" summary="" style="display: none">
<tr>
<td>Info 1</td>
<td>Seconde info 1</td>
<td>Troisieme info 1</td>
<td>Dernière info 1</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<p>Ligne 3</p>
</td>
<td>
<p>Titre quelconque 3</p>
</td>
<td>
<div id="blocinfo2" class="blocinfo">
<p><a href="./" title="Afficher les détails" onmouseover="affichermasquer('tableinfos2');" onmouseout="affichermasquer('tableinfos2');">Détails</a></p>
<table id="tableinfos2" summary="" style="display: none">
<tr>
<td>Info 0</td>
<td>Seconde info 0</td>
<td>Troisieme info 0</td>
<td>Dernière info 0</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
Teste déjà ça, je pense que ça devrait résoudre ton problème.<table summary="">
<tr>
<td>
<p>Ligne 1</p>
</td>
<td>
<p>Titre quelconque 1</p>
</td>
<td>
<div id="blocinfo0" class="blocinfo">
<p><a href="./" title="Afficher les détails"
onmouseover="affichermasquer('tableinfos0');"
onmouseout="affichermasquer('tableinfos0');">
<?php echo $row['nom']; ?></a>
</p>
<table id="tableinfos0" summary="" style="display: none">
<tr>
<td><?php echo $row['coordonnees'];?></td>
</tr>
</table>
Code : Tout sélectionner
SELECT nom,coordonnees from matable
<table id="tableinfos0" summary="" style="display: none">
<tr>
<td><?php echo $row['coordonnees'];?></td>
</tr>
</table>
par <table id="tableinfos0" summary="" style="display: none">
<tr>
<td><?php echo $row['nom'];?></td>
</tr>
</table> <?php
include("header.php");
include("menumod.php");
?>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Rechercher</title>
<link rel="stylesheet" type="text/css" href="css/transparent.css" />
<style type="text/css">
body {
background:;
font-family:Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
font-size: 11px;
}
a:hover {color:white;}
a {text-decoration:none; color:black;}
.Style1 {font-size: x-small}
</style>
<script type="text/javascript">
/* <![CDATA[ */
function $(elt)
{
return document.getElementById(elt);
}
function affichermasquer(idbloc)
{
var etat = $(idbloc).style.display;
$(idbloc).style.display = (etat == 'none') ? 'block' : 'none';
}
/* ]]> */
</script>
<style type="text/css">
/* <![CDATA[ */
div.blocinfo {
position: relative;
}
div.blocinfo p {
z-index: 10;
}
div.blocinfo table {
position: absolute;
top: 25px;
left: 0px;
border: 1px solid #ccc;
z-index: 20;
color: #000;
background-color: #efefef;
border-collapse: collapse;
}
div.blocinfo table td {
border: 1px solid #ccc;
}
/* ]]> */
</style>
</head>
<BODY>
<span class="Style2">
<form action="rechercho.php" method="post" name="f" enctype="multipart/form-data">
<td><input name="choix" value="nom" checked="checked" type="radio" />nom</td>
<td><input name="choix" value="Adresse" type="radio" />Adresse</td>
<td><input name="choix" value="CP" type="radio" />CP</td>
<td><input name="choix" value="VILLE" type="radio" />Ville</td>
<td> <input type=hidden name=count value="0" size=1
onkeydown="alert('Cette valeur est cre automatiquement!');
return false;">
<td><input type="text" name="recherche" size="30" maxlength="30" /></td>
<input type=hidden name=reset value="Restaurer">
<input name="Rechercher" type="submit" class="button" value="Rechercher" />
</td>
</form>
<div id="rechercheinfo" style="position:absolute;
left:350px; top:25px; visibility: hidden">
<table border=1 cellspacing=0 cellpadding=4>
<tr><td bgcolor=#FF9900>
<font size=2 face="arial,helvetica" color=#000000><b>
</b></font>
</td></tr></table>
</div>
<script language="JavaScript"><!--
document.f.recherche.onkeydown = function()
{ document.f.count.value++; }
document.f.reset.onclick = function()
{ return(confirm('Voulez-vous vraiment\n'
+'annuler toutes les saisies ?')); }
if(navigator.appName.indexOf('Netscape') != -1)
{
with (document)
{
f.count.onmouseover = function()
{ countinfo.visibility='visible'; }
f.count.onmouseout = function()
{ countinfo.visibility='hidden'; }
f.recherche.onmouseover = function()
{ rechercheinfo.visibility='visible'; }
f.recherche.onmouseout = function()
{ rechercheinfo.visibility='hidden'; }
f.reset.onmouseover = function()
{ resetinfo.visibility='visible'; }
f.reset.onmouseout = function()
{ resetinfo.visibility='hidden'; }
}
}
if(navigator.appName.indexOf('Explorer') != -1)
{
with (document)
{
f.count.onmouseover = function()
{ countinfo.style.visibility='visible'; }
f.count.onmouseout = function()
{ countinfo.style.visibility='hidden'; }
f.recherche.onmouseover = function()
{ rechercheinfo.style.visibility='visible'; }
f.recherche.onmouseout = function()
{ rechercheinfo.style.visibility='hidden'; }
f.reset.onmouseover = function()
{ resetinfo.style.visibility='visible'; }
f.reset.onmouseout = function()
{ resetinfo.style.visibility='hidden'; }
}
}
//--></script>
<?php
if ( !$_POST[choix] || !$_POST[recherche])
{
echo "<table width=100% border=1 align=center>";
echo "<td colspan=9 align=center bgcolor='#cccccc'>RECHERCHE :<img src='images/o.png' width='20' height='20'></td>"; echo "</table>";
exit;
} $connect=mysql_connect("localhost", "root", "") or die ("Echec de la connexion au serveur !");
$select=mysql_select_db("carnet");
$query = "SELECT nom,Adresse,CP,VILLE,coordonnees FROM ident
". $_POST[choix]." LIKE '%".$_POST[recherche]."' ORDER BY nom DESC";
$result=mysql_query($query);
$totenreg=mysql_num_rows($result);
if ( $result && mysql_num_rows($result) ==0)
echo "<td colspan=9 align=center bgcolor='#FFFFFF'><center>PAS DE REPONSES CORRESPONDANTES</td>";
else if ($result) {
echo "<table width=70% border=0 align=center summary="">";
echo "<tr bgcolor='#CCCCCC'>";
echo "<td colspan=9><b><center><span font-size='11px'><img src='images/o.png' width='20' height='20'>NOMBRE DE REPONSES : ".$totenreg."</td>";
echo "</tr>";
echo "<tr align=center bgcolor=#FFFFCC>";
echo "<td align=center span class=Style2>nom</td>";
echo "<td align=center span class=Style2>Adresse Postale</td>";
echo "</tr>";
$i=0;
while ($row=mysql_fetch_array($result)) {
if ($i==0) {
echo "<tr bgcolor=#CCFFFF>";
$i++; }
else {
echo "<tr bgcolor=#EEEEEE>";
$i--;
} ?>
<td span class=Style3><?php echo $row["nom"]; ?>
<div id="blocinfo0" class="blocinfo">
<p><a href="./" title="Afficher les coordonnées" onmouseover="affichermasquer('tableinfos0');" onmouseout="affichermasquer('tableinfos0');">Détails</a></p>
<table id="tableinfos0" summary="" style="display: none">
<tr>
<td><?php echo $row["coordonnees"]; ?></td>
</tr>
</table>
</div></td>
<td align=center span class=Style2><?php $row['Adresse']." ". $row['CP']." ". $row['VILLE'] ?></td></tr>
<?php } ?>
</table><?php }
?>
</body>
</html>
<div id="blocinfo<?php echo $j; ?>" class="blocinfo">
...
< ... onmouseover="affichermasquer('tableinfos<?php echo $j; ?>');" >
...
<?php $j++; ?>
Enfaite partout où tu as "0" il faut incrémenter avec une variable qui à chaque tour de boucle change.