View Full Version : 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.
RadarBob
01-27-2004, 09:40 PM
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.
<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>
RadarBob
01-27-2004, 09:43 PM
Oh, didn't like my file extension here it is; change the extension to ".js" to use it.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.