1. 隐藏表格第四列
  2. $('tr').find('td:eq(3)').hide();
  1. $('tr td:nth-child(4)').hide();

另外 :nth-child 还支持 :nth-child(2n+1) 这种写法, 返回奇数项, 2n 返回偶数项, 或者用 oddeven 代替公式. 当然, 类似 3n+5, 4n 这样的写法也是可以的. nth-child 的翻译应该就是 "第n个孩子"

     :nth-child(odd):odd 是有区别的: :odd 是所有返回项整体排序后其中的奇数项, 并且索引从0开始; 而 :nth-child(odd) 则是针对修饰项的子元素进行过滤和运算的(:nth-child 被称为 Child Filter), 并且索引是从1开始的.

posted on 2011-04-13 13:14  Jesser  阅读(2412)  评论(0)    收藏  举报