| Quote: |
| <!-- TWO STEPS TO INSTALL ROW ROLLOVER:
1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <style type="text/css"> <!-- #demo tr.ruled { background:#9cf; } --> </style> <script type="text/javascript"> <!-- /* This script and many more are available free online at ::http://nguoithuongoi.info::*/ function tableruler() { if (document.getElementById && document.createTextNode) { var tables=document.getElementsByTagName('table'); for (var i=0;i<tables.length;i++) { if(tables[i].className=='ruler') { var trs=tables[i].getElementsByTagName('tr'); for(var j=0;j<trs.length;j++) { if(trs[j].parentNode.nodeName=='TBODY') { trs[j].onmouseover=function(){this.className='ruled';ret urn false} trs[j].onmouseout=function(){this.className='';return false} } } } } } } window.onload=function(){tableruler();} // --> </script> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <table id="demo" class="ruler" summary="Table of my records" cellpadding="5"> <caption>Blues Artists & Songs</caption> <thead> <tr> <th scope="col">Artist</th> <th scope="col">Title</th> </tr> </thead> <tbody> <tr> <td>John Mayall </td> <td>Double Crossing Time </td> </tr> <tr> <td>Buddy Guy </td> <td>On A Saturday Night </td> </tr> <tr> <td>John Lee Hooker </td> <td>Don't Look Back </td> </tr> <tr> <td>Bo Diddley </td> <td>You Can't Judge a Book by Its Cover </td> </tr> <tr> <td>Billie Holiday </td> <td>Solitude </td> </tr> <tr> <td>Stevie Ray Vaughan </td> <td>Texas Flood </td> </tr> </tbody> </table> <p><center> <font face="arial, helvetica" size"-2">NTO<br> by <a href="http://nguoithuongoi.info">Tran Minh Tam</a></font> </center><p> <!-- Script Size: 2.68 KB --> |
Use this script to highlight rows in tables. Short but effective.
have fun.!
