Log in

View Full Version : How to do a hover popup over table rows



rlinsurf
01-29-2011, 11:52 PM
I have the following page:

http://take2records.com/test/dbtest.php?id_album=404&id_num=404100

I'm using php and mysql to generate the rows of a table. I need to have a popup occur when the user hovers over each row.

Here's the code which builds the table:


while($info = mysql_fetch_array( $data ))
{
$count++;
Print "<tr>";
Print "<th>Track:</th> <td>".$count."</td> ";
Print "<td>".$info['title'] . "</td> ";
Print "<th>Date:</th> <td>".$info['rec_date'] . "</td> ";
Print "<th>Composer:</th> <td>".$info['authors'] . "</td> ";
Print "<th>Artist:</th> <td>".$info['artists'] . "</td> ";
Print "<th>Time:</th> <td>".$info['time'] . "</td> ";
Print "<th>Blurb:</th> <td>".$info['blurb'] . " </td></tr>";
}
Print "</table>";

And in my CSS I have been able to change the row color while hovering:


tr:hover { background: #FCF; }

But I don't see how to do the popup.

websterthehamster
01-30-2011, 11:37 PM
The basic way to have text pop up when a user hovers over an element is this:

<tag title = "Your Text Here"></tag>

It doesn't allow styling, but gets the job done.