My table code. it’s included the popover button, that I want to show other detail than Name and Country.
while ($data = mysql_fetch_array($result))
{
echo "<tr>";
$Name = $data['Name'];
$Address = $data['Address'];
$Tel = $data['Tel'];
$Email = $data['Email'];
$Country = $data['Country'];
$ManufacturerKey = $data['ManufacturerKey'];
echo "<td>{$Name}</td><td>{$Country}</td>";
echo '<td><a href="#" id="detail" class="btn btn-danger" rel="popover" data-content="Test" data-original-title="detail">detail</a></td>';
echo "</tr>";
}
echo "</table></center>";
}
and Javascript:
<script>
$(function ()
{ $("#detail").popover({placement:'left'});
});
</script>
my problem is it’s confuse about the id.In the each table row it has same id like “detail”.How can I fix that ??
Thanks for all answer.Tell me if you want more code thanks so much.
Every tag must have an unique id, this html isn’t correct.
You have to use a class selector.
Edit :
Don’t forget to change the id. For example, you can do
id="detail'.$data['id'].'"if you have an id.In your
JS(jQueryas he usesbootstrap):