JS表格排序
时间:2006-11-11 来源:Erick_Kong
一个简单的JS表格排序,在网上搜了半天,没有找到合适的,所以自己写了一个:
[源码:]
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=GB18030">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>数据列表页面</TITLE>
<link rel="stylesheet" type="text/css" href="../theme/Style.css"/>
</HEAD> <BODY class="body" background="../../img/background_topic.jpg" onunload="closeWin();"> <!--列表标题-->
<p align="center" class="title">2006年XX征收统计[单位:元]</p>
<hr width="100"> <!--列表-->
<div align="center">
<center>
<table border="1" width="600" class="table" bordercolor="#003399" id="tab" style="position:absolute;left:30;top:100;">
<tr class="tabletitle">
<TD id="td1" colspan="2" cellspacing="0">
<TABLE border="0" width="100">
<TBODY>
<TR class="tabletitle">
<TD></TD>
<TD align="right" valign="bottom">类型</TD>
</TR>
<TR class="tabletitle">
<TD align="center" height="20" valign="bottom">区划</TD>
<TD align="center" valign="bottom">
状态 </TD>
</TR>
</TBODY>
</TABLE>
</TD>
<td>应缴费用  <a href="javascript:sort('应缴费用',0)">↑</a>  <a href="javascript:sort('应缴费用',1)">↓</a></td>
<td>实际征收费用  <a href="javascript:sort('实际征收费用',0)">↑</a>  <a href="javascript:sort('实际征收费用',1)">↓</a></td>
<td>征收率  <a href="javascript:sort('征收率',0)">↑</a>  <a href="javascript:sort('征收率',1)">↓</a></td>
</tr>
<tr>
<td rowspan="1" id="vtd1">
一市
</td>
<td>实征</td>
<td>1.443241266E7</td>
<td>1.362814917E7</td>
<td>94.43%</td>
<tr>
<td rowspan="1" id="vtd2">
二市
</td>
<td>实征</td>
<td>1.347895162E7</td>
<td>9918247.74</td>
<td>73.58%</td>
<tr>
<td rowspan="1" id="vtd3">
三市
</td>
<td>实征</td>
<td>1.245498821E7</td>
<td>1.154330773E7</td>
<td>92.68%</td>
<tr>
<td rowspan="1" id="vtd4">
四市
</td>
<td>实征</td>
<td>8217641.0</td>
<td>7722154.58</td>
<td>93.97%</td>
<tr>
<td rowspan="1" id="vtd5">
五市
</td>
<td>实征</td>
<td>1.577075931E7</td>
<td>1.663262121E7</td>
<td>100%</td>
<tr>
<td rowspan="1" id="vtd6">
六市
</td>
<td>实征</td>
<td>9360421.71</td>
<td>8939900.75</td>
<td>95.51%</td>
<tr>
<td rowspan="1" id="vtd7">
七市
</td>
<td>实征</td>
<td>6417726.05</td>
<td>5931752.37</td>
<td>92.43%</td>
<tr>
<td rowspan="1" id="vtd8">
八市
</td>
<td>实征</td>
<td>4275531.69</td>
<td>4241094.88</td>
<td>99.19%</td>
<tr>
<td rowspan="1" id="vtd9">
九市
</td>
<td>实征</td>
<td>1.123953092E7</td>
<td>1.028037566E7</td>
<td>91.47%</td>
<tr>
<td rowspan="1" id="vtd10">
十市
</td>
<td>实征</td>
<td>4556974.01</td>
<td>4615097.46</td>
<td>100%</td>
<tr>
<td rowspan="1" id="vtd11">
十一市
</td>
<td>实征</td>
<td>4910780.0</td>
<td>4802049.32</td>
<td>97.79%</td>
<tr>
<td rowspan="1" id="vtd12">
十二市
</td>
<td>实征</td>
<td>5488044.52</td>
<td>4830635.2</td>
<td>88.02%</td>
<tr>
<td rowspan="1" id="vtd13">
十三市
</td>
<td>实征</td>
<td>5989706.26</td>
<td>4791161.17</td>
<td>79.99%</td>
</tr>
</table>
</center>
</div>
</BODY> </HTML>
[示例] 2006年XX征收统计[单位:元]
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=GB18030">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>数据列表页面</TITLE>
<link rel="stylesheet" type="text/css" href="../theme/Style.css"/>
</HEAD> <BODY class="body" background="../../img/background_topic.jpg" onunload="closeWin();"> <!--列表标题-->
<p align="center" class="title">2006年XX征收统计[单位:元]</p>
<hr width="100"> <!--列表-->
<div align="center">
<center>
<table border="1" width="600" class="table" bordercolor="#003399" id="tab" style="position:absolute;left:30;top:100;">
<tr class="tabletitle">
<TD id="td1" colspan="2" cellspacing="0">
<TABLE border="0" width="100">
<TBODY>
<TR class="tabletitle">
<TD></TD>
<TD align="right" valign="bottom">类型</TD>
</TR>
<TR class="tabletitle">
<TD align="center" height="20" valign="bottom">区划</TD>
<TD align="center" valign="bottom">
状态 </TD>
</TR>
</TBODY>
</TABLE>
</TD>
<td>应缴费用  <a href="javascript:sort('应缴费用',0)">↑</a>  <a href="javascript:sort('应缴费用',1)">↓</a></td>
<td>实际征收费用  <a href="javascript:sort('实际征收费用',0)">↑</a>  <a href="javascript:sort('实际征收费用',1)">↓</a></td>
<td>征收率  <a href="javascript:sort('征收率',0)">↑</a>  <a href="javascript:sort('征收率',1)">↓</a></td>
</tr>
<tr>
<td rowspan="1" id="vtd1">
一市
</td>
<td>实征</td>
<td>1.443241266E7</td>
<td>1.362814917E7</td>
<td>94.43%</td>
<tr>
<td rowspan="1" id="vtd2">
二市
</td>
<td>实征</td>
<td>1.347895162E7</td>
<td>9918247.74</td>
<td>73.58%</td>
<tr>
<td rowspan="1" id="vtd3">
三市
</td>
<td>实征</td>
<td>1.245498821E7</td>
<td>1.154330773E7</td>
<td>92.68%</td>
<tr>
<td rowspan="1" id="vtd4">
四市
</td>
<td>实征</td>
<td>8217641.0</td>
<td>7722154.58</td>
<td>93.97%</td>
<tr>
<td rowspan="1" id="vtd5">
五市
</td>
<td>实征</td>
<td>1.577075931E7</td>
<td>1.663262121E7</td>
<td>100%</td>
<tr>
<td rowspan="1" id="vtd6">
六市
</td>
<td>实征</td>
<td>9360421.71</td>
<td>8939900.75</td>
<td>95.51%</td>
<tr>
<td rowspan="1" id="vtd7">
七市
</td>
<td>实征</td>
<td>6417726.05</td>
<td>5931752.37</td>
<td>92.43%</td>
<tr>
<td rowspan="1" id="vtd8">
八市
</td>
<td>实征</td>
<td>4275531.69</td>
<td>4241094.88</td>
<td>99.19%</td>
<tr>
<td rowspan="1" id="vtd9">
九市
</td>
<td>实征</td>
<td>1.123953092E7</td>
<td>1.028037566E7</td>
<td>91.47%</td>
<tr>
<td rowspan="1" id="vtd10">
十市
</td>
<td>实征</td>
<td>4556974.01</td>
<td>4615097.46</td>
<td>100%</td>
<tr>
<td rowspan="1" id="vtd11">
十一市
</td>
<td>实征</td>
<td>4910780.0</td>
<td>4802049.32</td>
<td>97.79%</td>
<tr>
<td rowspan="1" id="vtd12">
十二市
</td>
<td>实征</td>
<td>5488044.52</td>
<td>4830635.2</td>
<td>88.02%</td>
<tr>
<td rowspan="1" id="vtd13">
十三市
</td>
<td>实征</td>
<td>5989706.26</td>
<td>4791161.17</td>
<td>79.99%</td>
</tr>
</table>
</center>
</div>
</BODY> </HTML>
[示例] 2006年XX征收统计[单位:元]
|
应缴费用 ↑ ↓ | 实际征收费用 ↑ ↓ | 征收率 ↑ ↓ | ||||
一市 | 实征 | 1.443241266E7 | 1.362814917E7 | 94.43% | |||
二市 | 实征 | 1.347895162E7 | 9918247.74 | 73.58% | |||
三市 | 实征 | 1.245498821E7 | 1.154330773E7 | 92.68% | |||
四市 | 实征 | 8217641.0 | 7722154.58 | 93.97% | |||
五市 | 实征 | 1.577075931E7 | 1.663262121E7 | 100% | |||
六市 | 实征 | 9360421.71 | 8939900.75 | 95.51% | |||
七市 | 实征 | 6417726.05 | 5931752.37 | 92.43% | |||
八市 | 实征 | 4275531.69 | 4241094.88 | 99.19% | |||
九市 | 实征 | 1.123953092E7 | 1.028037566E7 | 91.47% | |||
十市 | 实征 | 4556974.01 | 4615097.46 | 100% | |||
十一市 | 实征 | 4910780.0 | 4802049.32 | 97.79% | |||
十二市 | 实征 | 5488044.52 | 4830635.2 | 88.02% | |||
十三市 | 实征 | 5989706.26 | 4791161.17 | 79.99% |
相关阅读 更多 +