$('.views-table').children('tbody').children('tr').each(function(i)
{
this.style.color=['#f00','#0f0','#00f'][i];
});
$("p").each(function(i){this.style.color=['#f00','#0f0','#00f'][i]})
//为索引分别为0,1,2的p元素分别设定不同的字体颜色。
也可以用 $.each($('p'), function(i){this.style.color=['#f00','#0f0','#00f'][i]})
$("tr").each(function(i){this.style.backgroundColor=['#ccc','#fff'][i%2]})
//实现表格的隔行换色效果
$.each( [0,1,2], function(i, n){ alert( "Item #" + i + ": " + n ); });