js 静态HTML表格排序功能实现
2009-02-11 00:00
901 查看
无标题文档
*{font-family:Arial, Helvetica, sans-serif;font-size:14px;border:none;}
body{text-align:center;}
table{margin:100px auto;}
td{width:100px;height:24px;text-align:center;line-height:24px;border:1px solid silver;}
.red{color:red;}
.top{background:#CCCCCC;cursor:pointer;}
.up{background:#FFFFCC url(/upload/20090211095733175.gif) no-repeat right 5px;}
.down{background:#FFFFCC url(/upload/20090211095734843.gif) no-repeat right 5px;}
.hov{background:#F0EFE5;}
kick mekick mekick mekick me
15.43
700
1.220
阿
7.05
4
3,000
炳
30.62
30
2,558,800
和
22.30
56
瞎
26.31
0.65
-
63.16
74
子
var tableSort = function(){
this.initialize.apply(this,arguments);
}
tableSort.prototype = {
initialize : function(tableId,clickRow,startRow,endRow,classUp,classDown,selectClass){
this.Table = document.getElementById(tableId);
this.rows = this.Table.rows;//所有行
this.Tags = this.rows[clickRow-1].cells;//标签td
this.up = classUp;
this.down = classDown;
this.startRow = startRow;
this.selectClass = selectClass;
this.endRow = (endRow == 999? this.rows.length : endRow);
this.T2Arr = this._td2Array();//所有受影响的td的二维数组
this.setShow();
},
//设置标签切换
setShow:function(){
var defaultClass = this.Tags[0].className;
for(var Tag ,i=0;Tag = this.Tags[i];i++){
Tag.index = i;
addEventListener(Tag ,'click', Bind(Tag,statu));
}
var _this =this;
var turn = 0;
function statu(){
for(var i=0;i
*{font-family:Arial, Helvetica, sans-serif;font-size:14px;border:none;}
body{text-align:center;}
table{margin:100px auto;}
td{width:100px;height:24px;text-align:center;line-height:24px;border:1px solid silver;}
.red{color:red;}
.top{background:#CCCCCC;cursor:pointer;}
.up{background:#FFFFCC url(/upload/20090211095733175.gif) no-repeat right 5px;}
.down{background:#FFFFCC url(/upload/20090211095734843.gif) no-repeat right 5px;}
.hov{background:#F0EFE5;}
kick mekick mekick mekick me
15.43
700
1.220
阿
7.05
4
3,000
炳
30.62
30
2,558,800
和
22.30
56
瞎
26.31
0.65
-
63.16
74
子
var tableSort = function(){
this.initialize.apply(this,arguments);
}
tableSort.prototype = {
initialize : function(tableId,clickRow,startRow,endRow,classUp,classDown,selectClass){
this.Table = document.getElementById(tableId);
this.rows = this.Table.rows;//所有行
this.Tags = this.rows[clickRow-1].cells;//标签td
this.up = classUp;
this.down = classDown;
this.startRow = startRow;
this.selectClass = selectClass;
this.endRow = (endRow == 999? this.rows.length : endRow);
this.T2Arr = this._td2Array();//所有受影响的td的二维数组
this.setShow();
},
//设置标签切换
setShow:function(){
var defaultClass = this.Tags[0].className;
for(var Tag ,i=0;Tag = this.Tags[i];i++){
Tag.index = i;
addEventListener(Tag ,'click', Bind(Tag,statu));
}
var _this =this;
var turn = 0;
function statu(){
for(var i=0;i
相关文章推荐
- js 静态HTML表格排序功能实现
- JS实现HTML表格排序功能
- Vue.js实现多条件筛选、搜索、排序及分页的表格功能
- Vue.js实现多条件筛选、搜索、排序及分页的表格功能
- JS实现table表格数据排序功能(可支持动态数据+分页效果)
- JS简单实现表格排序功能示例
- js实现表格的排序功能
- 使用Vue.js实现表格的排序和搜索功能
- Vue.js实现多条件筛选、搜索、排序及分页的表格功能
- js实现页面的表格排序功能
- Vue.js实践:实现多条件筛选、搜索、排序及分页的表格功能
- 【排序】静态表格实现排序功能
- JS简单实现表格排序功能示例
- html table表格导出excel的方法 html5 table导出Excel HTML用JS导出Excel的五种方法 html中table导出Excel 前端开发 将table内容导出到excel HTML table导出到Excel中的解决办法 js实现table导出Excel,保留table样式
- html+js+css实现计算器功能
- js+html+css实现简单页面交互功能(2015知乎前端笔试题)http://v.youku.com/v_show/id_XMTI0ODQ5NTAyOA==.html?from=y1.7-1.2
- jsp+js实现可排序表格
- js实现表格全选功能
- 在Web页面中实现数据表格的排序功能(全部数据,非当前页)
- AngularJS模糊查询功能实现代码(过滤内容下拉菜单排序过滤敏感字符验证判断后添加表格信息)