Highlighting a Query Result

I want to highlight each line of a query. I means that when the mouse pointer get over a line of the outputed query, the whole line get highlighted.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

kkhippleConnect With a Mentor Commented:
 <script LANGUAGE="JavaScript">
function TrowOn(src,OnColor){
src.style.cursor = 'hand';
 src.bgColor = OnColor;
function TrowOff(src,OffColor){
src.style.cursor = 'default';
src.bgColor = OffColor;

<table id="mainTable">
<tr onMouseOver="TrowOn(this,'#ffffcc');" onMouseOut="TrowOff(this,'#DFDFDF');">
<td>CELL 1</td>
 <td>CELL 2</td>
<td>CELL 3</td>
<tr onMouseOver="TrowOn(this,'#ffffcc');" onMouseOut="TrowOff(this,'#DFDFDF');"> <td>CELL 4/td> <td>CELL 5/td> <td>CELL 6/td>
Hi Michael_O,
you can hightlight links like
<STYLE TYPE="text/css">
a:link { color: blue; text-decoration: none }
a:active { color: red; text-decoration: none }
a:visited { color: blue; text-decoration: none }
a:hover { color: green; text-decoration: underline }

Hi Michael_O,
Using CSS you can highlight table cells and other elements when a user mouse's over. For an example see the menu above, the colour changes from grey to blue. This is simply achieved by using CSS's Hover property:

Define the style of your navigation, within your style sheet:

.menu { background-color: #E9E9E9; font-size: 11px; color: #000000 }

Now apply this to your table cells:

<td class="menu">

Now define how the menu will look when someone hovers over:

td.menu :hover {background-color: #669966; display: block;}

This should work well, you don't have to apply this only to table cells, it could be applied to individual links by removing the ".td" prefix. You can also change other properties instead of just the background colour, for example the font style or colour.

I would go with kkhipple's idea of highlighting on the table row, but for more details this kind of question would get a bunch of different answers in the Cascading Stylesheet Topic Area CSS:

All Courses

From novice to tech pro — start learning today.