Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:46:47+00:00 2026-05-13T08:46:47+00:00

My problem is that I have a table, but I only want a subset

  • 0

My problem is that I have a table, but I only want a subset of the rows, from first index to last index. I thought you could do it like this:

$('table tr:gt(2):lt(5)');

I thought it would give you only rows #3 and #4 but it ends up giving you more than that. How can I tell the selector to choose only rows #3 and #4?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:46:48+00:00Added an answer on May 13, 2026 at 8:46 am

    You’re pretty close, but the problem in your selector is the :lt(5) filter.

    You would want something like:

    $('table tr:gt(2):lt(2)');
    

    The difference is that by the time the lt() filter is applied, the first three elements were already removed from the set (by the gt() filter). So this will grab the 3rd and 4th element (zero-indexed), instead of the 3rd through the 8th.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with jquery and a dynamic table. I want a click
I have two tables that I'm querying from. In one table, there are fields
A colleague came to me with a problem that I managed to answer but
I have a table that contains partial data that is of no use to
I'm displaying a table with multiple rows and columns. I'm using a JQUERY plugin
I am facing a conceptual problem that I am having a hard time overcoming.
I have a python program in an embedded system that needs to write to
I am having problem with how the primary key gets incremented when I delete_all
I want to make a database user, which would use my predefined functions (login(pass,
I'm using EclipseLink as the JPA provider. Further I'm using the following TABLE_PER_CLASS inheritance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.