使用jQuery如何选择行范围? [英] Using jQuery how do I select a range of rows?

查看:65
本文介绍了使用jQuery如何选择行范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在用于从表中选择行范围的仅jQuery解决方案?

Does a jQuery only solution exist for selecting a range of rows from a table?

我知道'eq','lt','gt'存在,但我正在寻找这些选择器的组合.

I know 'eq', 'lt', 'gt' exist, but I'm looking for a combination of those selectors.

推荐答案

您可以一次应用多个过滤器,尽管第二个过滤器适用于第一个过滤器的结果,因此以下内容将从第四行开始突出显示(跳过0..2),并突出显示3行(包括0..2):

You can apply more than one filter at a time, although the 2nd filter applies to the results of the first, so the following would highlight starting from the 4th row (skips 0..2), and highlight for 3 rows (includes 0..2):

$('#t tr:gt(2):lt(3)').css('background-color', '#f00');

这篇关于使用jQuery如何选择行范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆