解决方案 »

  1.   


       function out(obj) {
             obj.style.color = 'black';
         }
     
     
            function on(obj) {
                            obj.style.color = 'red';
                        }
      

  2.   

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>JS Bin</title>
    </head>
    <body>
      <script>
        function on(a){a.style.color="#f00"}
        function out(a){a.style.color="#000"}
      </script>
      <table>
        <tr onmouseover="on(this)" onmouseout="out(this)"><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td></tr>
        <tr onmouseover="on(this)" onmouseout="out(this)"><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td></tr>
        <tr onmouseover="on(this)" onmouseout="out(this)"><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td><td>aaaaaa</td></tr>
      </table>
    </body>
    </html>
      

  3.   


    function out(obj) {
         obj.style.color = 'black';
         obj.style.fontSize = '15px';
    }
     
     
     function on(obj) {
         obj.style.color = 'red';
         obj.style.fontSize = '18px';
     }改字体大小吧  。
      

  4.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    tr:hover{ color:#f00}
    table tr td{ width:400px; height:20px; border:#CCCCCC 1px solid;}
    </style>
    </head>
    <body>
    <table>
    <tr><td>sadf </td></tr>
    <tr><td>asdf</td></tr>
    <tr><td>sadf</td></tr>
    <tr><td>sadf</td></tr>
    <tr><td>asdf</td></tr>
    <tr><td>asdf</td></tr>
    </table>
    </body>
    </html>
      

  5.   

    td和tr具有特殊性,无法直接上下移位. 可以在里面内嵌一个span, 来做span<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test</title>
    <style type="text/css">
    table tr td{ width:100px; height:20px; border:#000 1px solid;}
    td span:hover{margin-top:-5px;display:block;}
    </style>
    </head>
    <body>
    <table>
    <tr><td><span>chssjds</span> </td></tr>
    <tr><td><span>gxyjds</span></td></tr>
    <tr><td><span>tnbjds</span></td></tr>
    <tr><td><span>sadf</span></td></tr>
    <tr><td><span>asdf</span></td></tr>
    <tr><td>asdf</td></tr>
    </table>
    </body>
    </html>