table

table

{

border-top:1px solid black;

border-left:1px solid black;

cursor:default;

}

td

{

border-bottom:1px solid black;

border-right:1px solid black;

height:23px;

}

function change(el)

{

var x = el.rowIndex;

el.style.backgroundColor = ++d[x]%2 ? "#CCCCFF" : "#E1E9FD";

}

function out(el)

{

var x = el.rowIndex;

if (d[x]%2==0) el.style.backgroundColor = "";

}

function over(el)

{

var x = el.rowIndex;

if (d[x]%2==0) el.style.backgroundColor = "#E1E9FD";

}

one two three four
       
       
       
       
       
       
       

效果如下:

0818b9ca8b590ca3270a3433284dd417.png

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐