Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tables: How to delete younger TDs

    I want to walk up the node tree in a set of deeply nested tables from a starting point of interest. Each time I reach a TD element I want to delete any 'next siblings' (TD elements to the right) thus removing any content to the right of my walk.

    I think I have to do this from the parent TR element (currNode.parentNode.deleteCell(#)) but I don't know how to determine the index of the current TD to know that # is greater.

    Can anyone show me a reference or a code snippet about how to do this?

    Thanks.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    TD.cellIndex should be what you're after.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Take a look here, this may be of some help.




    http://www.webreference.com/dhtml/di...os2/index.html

  • #4
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yowwp! I can't believe I didn't see cellIndex in my book. What a dummy. And the webreference url is a big help, too. Thanks to both of you guys.

    I also realized that I could just set currNode.nextSibling.style.display to "none" when the tagName is "TD" and do it that way.

    Thanks, again.
    jflowers@ezo.net


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •