The first one is too simple to mention, and the second one is very simple, but everyone has different implementation methods. The following is a concise method, which supports IE6, IE7, and FF2, other browsers have not been tested (you can extend to ASP. NET in the GridView ):
<Html> <pead> <title> change color when you move the cursor over a table-concise implementation </title> <style type = "text/css"> # tb {width: 666px; border-collapse: collapse; border: 1px solid # EEE; font-size: 14px ;}# tb th {background :# EEE; border-bottom: 1px solid # CCC; padding: 4px ;}# tb td {border: 1px solid # EEE; padding: 4px ;} </style> </pead> <body> <table id = "tb"> <tr> <th> item name </th> <th> unit price </th> <th> Inventory quantity </th> <th> goods location </th> </tr> <td> Ding Xue's favorite xiansi deluxe edition-lingsha edition </td> <td> 139 </td> <td> 10000000 </td> <td> A12-253 </td> </tr> <td> xiansi deluxe edition-mengshu Edition </td> <td> 139 </td> <td> 10000000 </td> <td> A12-254 </td> </tr> <td> -Initial </td> <td> 69 </td> <td> 10000000 </td> <td> A12-255 </td> </tr> </table>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]