Relative Position of the Table row

Asked

Viewed 168 times

0

  • I have a table with 50 lines
  • Of these only 10 are visible
  • Added the css class "ux-select" to line 5

The code $('table tbody tr:visible.ux-select').index() will tell me what the row number in the context of the table as a whole (will return 5)

Question: How do I get the relative position of this line, IE, as the table only has 10 visible lines, the line 5 that is with the class ux-select, is in what position among the visible ones? (1st? 2nd? 3rd?.... nº?)

  • 1

    Put the code of how this table was assembled, it would be easier to help you :). If it is too big use jsfiddle

  • The table is 100% dynamic! So I gave a simple and very generic example! More if you answer based on it already helps me!

  • it can be dynamic, but it is generated only html for the browser, you can try right button to display source code..

  • I edited the question! see if I can be clearer now!

1 answer

0


  • This does not answer the question. When you have reputation enough, you’ll be able to leave comments on any post but until then, write only answer that no depend on more information of who asked. - Of Revision

  • Hello, I’m new here but I didn’t understand your placement. The answer I put did not depend on more information, because I put up an example link. I just edited and put the code right in the answer.

  • @Diegosantos, thanks brother! helped a lot

  • The way it was, I couldn’t understand your solution without accessing the link. Even if the answer is on the link, it is important that it is described in your reply so that it is not lost with possible broken links.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.