- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › jQuery: if tr row count?
Hi there!
I’m working on something like this:
http://jsfiddle.net/yGM3m/
But it won’t work. It’s displaying the “before” and “after” dom manipulations on both tables, when I only want it on the second table.
I think I’m close. Help?
i don’t really understand what you want to achieve.
for this:
> It’s displaying the “before” and “after” dom manipulations on both tables, when I only want it on the second table.
you can put different element id
You had a couple of problems going on. For starters, you had two divs with the same ID, this is a big no no. In my example I have changed them to classes.
Secondly, your comparison looked like this `rowCount = 7` which will *always* return true. What you were looking for is either `rowCount === 7` or `rowCount >= 7`.
I also added an `each()` loop if you are going to have multiple dimension tables on a single page.
@mweldan – Sorry that I may have written my post incoherently. TheDoc has done what I needed. Thank you, though!
@TheDoc – That’s exactly what I was looking for. Actually, I added the two ID’s on Jsfiddle, but the 2 tables won’t be on the page at the same time. :) Thank you! I knew I was close, but the operators were off.