Search HouseOfScripts.com

 

All Scripts        JavaScripts        ASP Scripts        Other Scripts

 

  How to Sort Columns in the Table asp, send, email, cdonts, link, recordset, hyper, hyperlink, create, list, box, dependant, dynamic

I found this script on http://www.javascriptkit.com and I think this is cool. There are a few steps involved:

Name
Grade
Ranking
Mike Goodman
84.3
3
Ginger Mah
87.8
2
Joe Down
69
4
Bruce Will
97.5
1

1. You need to download file "sorttable.js" Place it for example in the folder calles "Scripts".

2. Place the following code into the HEAD section:

<script>

//Sortable table script- Han Yu han@velocityhsi.com
//Script featured on http://www.javascriptkit.com

var domok=document.all||document.getElementById
if (domok)
document.write('<SCRIPT SRC="Scripts/sortTable.js"><\/SCRIPT>')
</script>

3. The followin is an example of the BODY section:

<body onLoad='if (domok) initTable("table0")'>

<table ID="table0" border="1" width="600" cellspacing="0" cellpadding="0" >
<tr><th>Name</th><th>Grade</th><th>Ranking</th></tr>
<td width="33%">Mike Goodman</td>
<td width="33%">84.3</td>
<td width="34%">3</td>
<tr>
<td width="33%">Ginger Mah</td>
<td width="33%">87.8</td>
<td width="34%">2</td>
</tr>
<tr>
<td width="33%">Joe Down</td>
<td width="33%">69</td>
<td width="34%">4</td>
</tr>
<tr>
<td width="33%">Bruce Will</td>
<td width="33%">97.5</td>
<td width="34%">1</td>
</tr>
</table>

</body>

You want to see more? Go to More About Sorting Columns in a Table.

 

 


Home       Scripts       Active WebTools       Web Templates       Forum       Tools        Hosting       Questions/Comments       Add/Request