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
    mmm
    mmm is offline
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to sort a table having a table inside one of its cells

    i need help in sorting a table having another table inside it.
    i would be thankful if any one helps me in getting a solution for this.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Attached is code that sorts a table of data. Read inline comments.

    I suppose for your application you would pass it the <tbody> tag ID for that inner table.

    Summary:
    Click on table heading to sort by that column. Here's how I set it up. parameters are explained in the code listing.
    Code:
    <html>
     <head>
        <script type='text/javascript/ src='filepath/table_sort.js'></script>
    
     </head>
    
     <body>
      <table>
        <th onclick="return sortTable('systemList', 0, false); ">This column</th>
        <th onclick="return sortTable('systemList', 1, false); ">That column</th>
        <th onclick="return sortTable('systemList', 2, false); ">'nuther column</th>
    
        <tbody id='systemList'>
          <!-- table data rows here -->
        </tbody>
      </table>
    
     </body>
    </html>

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, didn't like my file extension here it is; change the extension to ".js" to use it.
    Attached Files Attached Files

  • #4
    mmm
    mmm is offline
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks a lot,i'll try it


  •  

    Posting Permissions

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