Get the table row index from table DOM2

Discussion in 'Javascript' started by sudhaoncyberworld@gmail.com, Dec 5, 2005.

  1. Guest

    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, 2005
    #1
    1. Advertising

  2. RobG Guest

    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/DOM:table.insertRow >



    --
    Rob
     
    RobG, Dec 5, 2005
    #2
    1. Advertising

  3. 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/
     
    Martin Honnen, Dec 5, 2005
    #3
  4. Guest

    Thanx a lot
     
    , Dec 5, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Spartanicus
    Replies:
    2
    Views:
    548
  2. Simon Brooke
    Replies:
    8
    Views:
    4,217
    Simon Brooke
    Feb 11, 2006
  3. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    323
    Tomasz Chmielewski
    Mar 4, 2008
  4. table row property DOM2

    , Dec 5, 2005, in forum: Javascript
    Replies:
    4
    Views:
    144
    Thomas 'PointedEars' Lahn
    Dec 6, 2005
  5. Giggle Girl

    ie6 Insert Row at specific Row Index of Table

    Giggle Girl, Feb 5, 2006, in forum: Javascript
    Replies:
    18
    Views:
    297
    Thomas 'PointedEars' Lahn
    Feb 7, 2006
Loading...

Share This Page