使用jquery表格排序
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>简单排序</title>
<script src="jquery-1[1].2.2.js" type="text/javascript"></script>
<script src="jquery.tablesorter.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){$("#mytable").tablesorter();})
</script>
<form id="form1" runat="server">
<div>
<table id="mytable" border="1">
<thead>
<tr>
<th style="cursor:pointer;">姓名</th>
<th style="cursor:pointer;">学号</th>
<th style="cursor:pointer;">性别</th>
</tr>
</thead>
<tbody>
<tr>
<td>贝贝</td>
<td>998</td>
<td>男</td>
</tr>
<tr>
<td>小宝</td>
<td>997</td>
<td>女</td>
</tr>
<tr>
<td>小马</td>
<td>996</td>
<td>男</td>
</tr>
<tr>
<td>书行</td>
<td>995</td>
<td>女</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>简单排序</title>
<script src="jquery-1[1].2.2.js" type="text/javascript"></script>
<script src="jquery.tablesorter.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){$("#mytable").tablesorter();})
</script>
<form id="form1" runat="server">
<div>
<table id="mytable" border="1">
<thead>
<tr>
<th style="cursor:pointer;">姓名</th>
<th style="cursor:pointer;">学号</th>
<th style="cursor:pointer;">性别</th>
</tr>
</thead>
<tbody>
<tr>
<td>贝贝</td>
<td>998</td>
<td>男</td>
</tr>
<tr>
<td>小宝</td>
<td>997</td>
<td>女</td>
</tr>
<tr>
<td>小马</td>
<td>996</td>
<td>男</td>
</tr>
<tr>
<td>书行</td>
<td>995</td>
<td>女</td>
</tr>
</tbody>
</table>
</div>
</form>
</body>
</html>