1. 程式人生 > 其它 >隔行換色

隔行換色

Documen

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

     //奇數 tr:nth-child(even)
{ background-color: aqua; }
    
     //偶數 tr:nth-child(odd){ background-color: blue; }

      //觸控 tr:hover { background-color: black; }       //點選 tr:active { background-color:
red; } #tab { width: 800px; height: 100px; } </style> </head> <body> <table border="1" id="tab" cellspacing="0" > <tr> <th></th> <th></th> <th></
th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> <tr> <th></th> <th></th> <th></th> <th></th> </tr> </table> </body> </html>

顏色將就將就