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

  • SEARCH
  • Home
  • 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 7193615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:12:22+00:00 2026-05-28T20:12:22+00:00

Ok, basically, I have an element that I get which happens to be a

  • 0

Ok, basically, I have an element that I get which happens to be a <tr> element.

But If I find a <td> element with a rowspan that is greater than 1, within any of the <tr> elements, I need to exclude these <tr> elements, starting with the $(“td”).parent() of where the rowspan > 1, and I need to exclude all other <tr> elements up to the rowspan quantity within an each()

So something like this:

$("td").each(function{
if ($(this).attr('rowspan') > 1)
    var curRowspan = $(this).attr('rowspan');
    // So now rowspan can equal 2, 3, 4, 5, and higher.
    // Now I need to exclude the NEXT <tr> elements based on the quantity of rowspans.
    // So if the rowspan = 2, than I need to exclude $(this).parent() and $(this).parent().next() which seems easy enough, but I need this to work on more than 2 rowspans also.  Needs to exclude the current <tr> element and all <tr> elements after, until it reaches the rowspan quantity indicated by curRowspan.
    // HOW TO DO THIS and return false out of the each() for each of these `<td>` elements within that quantity of `<tr>` elements indicated by the rowspan of a `<td>` element???
});
  • 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-28T20:12:23+00:00Added an answer on May 28, 2026 at 8:12 pm

    You could add a class to indicate you are ignoring that row. I feel as though there is a better way to optimize this selector though. Slice looks promising.

    http://jsfiddle.net/UG35Q/2/

    $("td").each(function() {
        if ($(this).attr('rowspan') > 1) {        
            var curRowspan = $(this).attr('rowspan');
            $(this).parent().nextAll().slice(0, curRowspan).addClass('markRow');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My specific use case is that I have a WYSIWYG editor which is basically
There's a function that I have written which basically does encryption for me 4
I have the following code which recursively operates on each element within a List
I basically have a page which shows a processing screen which has been flushed
I basically have 7 select statements that I need to have the results output
Suppose we have an abstract class Element from which classes Triangle and Quadrilateral are
I have ObservableCollection<Foo> that is bound to an ItemsControl (basically displaying a list). Foo
I have a very simple question but cannot find a simple answer. I have
This is what I have This is what I want Basically the orange element
Im trying to get the ID of the <div> element here so that i

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.