highlight a row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • snet

    highlight a row

    I have a table of many rows which is made of many cloumns.

    Using CSS I would like to highlight an entire given row when the mouse is
    over it.

    I know a:hover will do this, but not every column of the row will be a link.

    Is what I am seeking possible, and if so, could someone point me in the
    right direction?

    Thank you for you help


  • Evertjan.

    #2
    Re: highlight a row

    snet wrote on 15 jul 2003 in comp.infosystem s.www.authoring.stylesheets:[color=blue]
    > I have a table of many rows which is made of many cloumns.
    > Using CSS I would like to highlight an entire given row when the mouse
    > is over it.
    > I know a:hover will do this, but not every column of the row will be a
    > link.
    > Is what I am seeking possible, and if so, could someone point me in
    > the right direction?[/color]

    Use javascript + css:

    ========== test.html =========

    <style>
    tr.tr td {background-color:white;}
    tr.trred td {background-color:yellow;}
    </style>

    <script>
    function h(x){
    x.className="tr red"
    }
    function n(x){
    x.className="tr "
    }
    </script>

    <table border=1>

    <tr class="tr"
    onmouseover="h( this)"
    onmouseout="n(t his)">
    <td>qwerty</td><td>qwerty</td></tr>

    <tr class="tr"
    onmouseover="h( this)"
    onmouseout="n(t his)">
    <td>qwerty</td><td>qwerty</td></tr>

    <tr class="tr"
    onmouseover="h( this)"
    onmouseout="n(t his)">
    <td>qwerty</td><td>qwerty</td></tr>

    </table>

    =============== ==========

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    Working...