Highlighting a Query Result

Posted on 2004-10-28
Last Modified: 2013-12-24
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.
Question by:Michael_O
    LVL 22

    Expert Comment

    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 }

    LVL 22

    Expert Comment

    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: :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.

    LVL 5

    Accepted Solution

     <script LANGUAGE="JavaScript">
    function TrowOn(src,OnColor){ = 'hand';
     src.bgColor = OnColor;
    function TrowOff(src,OffColor){ = '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>
    LVL 35

    Expert Comment

    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:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Product Review - Android Remix

    Come along for the ride with our Senior Product Manager, Brian Matis, as he reviews the Android Remix.

    Suggested Solutions

    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now