Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Get the table row index from table DOM2

Reply
Thread Tools

Get the table row index from table DOM2

 
 
sudhaoncyberworld@gmail.com
Guest
Posts: n/a
 
      12-05-2005
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

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      12-05-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      12-05-2005


(E-Mail Removed) 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/
 
Reply With Quote
 
sudhaoncyberworld@gmail.com
Guest
Posts: n/a
 
      12-05-2005
Thanx a lot

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sorting index-15, index-9, index-110 "the human way"? Tomasz Chmielewski Perl Misc 4 03-04-2008 05:01 PM
DOM2 API (Java): how to get namespace declarations? Simon Brooke XML 8 02-11-2006 07:38 PM
ie6 Insert Row at specific Row Index of Table Giggle Girl Javascript 18 02-07-2006 07:54 AM
table row property DOM2 sudhaoncyberworld@gmail.com Javascript 4 12-06-2005 03:28 PM
How to access ul element's style via DOM2? Spartanicus HTML 2 11-10-2004 04:33 AM



Advertisments