By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,237 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,237 IT Pros & Developers. It's quick & easy.

Get the table row index from table DOM2

P: n/a
Hi all

I have n tr elements in my table. i want to insert some tr in b/w trs.
so i know only row id of particular row( ex: n) and i want to insert at
n+1th position. So i want to find out the row index of my n'th
element.Is there any direct way to find out the index

hope u got my question

Thanks

Dec 5 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
su***************@gmail.com wrote:
Hi all

I have n tr elements in my table. i want to insert some tr in b/w trs.
so i know only row id of particular row( ex: n) and i want to insert at
n+1th position. So i want to find out the row index of my n'th
element.Is there any direct way to find out the index

hope u got my question


Use insertRow:

<URL: http://developer.mozilla.org/en/docs...able.insertRow >

--
Rob
Dec 5 '05 #2

P: n/a


su***************@gmail.com wrote:

So i want to find out the row index of my n'th
element.Is there any direct way to find out the index


A table row element object has a property named rowIndex
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-67347567>
and a property named sectionRowIndex
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79105901>
Check the docs there, depending on how your table is structured and
where you want to insert one of those properties might give you what you
are looking for.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 5 '05 #3

P: n/a
Thanx a lot

Dec 5 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.