Click here to Skip to main content
15,914,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

How to get the table visible row index using jquery or javascript.

ie if table consits of 10 rows and by the time of viewing only five are visible and remaining are in scroll area so here my question is how to get the first and last row index which are visible in the table present.

Thanks in Advance
Seshu
Posted

1 solution

Hi,

What i understand is, you have scroll bar in your page and if only 5 records are visible then you want it in javascript. you want to get how many records are currently display and how many records will be display after scroll. Am i correct ?

If this is the scenario then i don't think so any solution available to check that. it's all depend upon resolution of the screen. someone have high resolution so he can view all data and someone do not have. you can not calculate logically.

But using screen object you can get height of the screen and you already have height of the row. so through that calculation you may get the visible row. but i will not prefer to do that.

BTW why you have such requirement ?

Thanks
-Amit Gajjar
 
Share this answer
 
Comments
tnsk 3-Sep-12 5:04am    
Based on the present visible first and last row i have to do some calculations is there any possible way to get those..

Thanks
Seshu
AmitGajjar 3-Sep-12 5:06am    
Please read my answer. i have already given you solution(but not feasible). you can not be sure on that data. but if you want to do it then you can do like that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900