<!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" xmlns:v="urn:schemas-microsoft-com:vml">
<!-- <!doctype html>
<html lang="zh"> -->
<head>
<style type="text/css">
<!--
td { text-align:center;font-size:12px;padding:3px;}
.tablelist tr.theOne{
background-color:#FAFAFF;
line-height:200%;
}
.tablelist tr.other{
background-color:#e0e0e0;
line-height:180%;
}
.tablelist tr.other1{
background-color:#FAFAFF;
line-height:180%;
}
.tablelist tr.other2{
background-color:#EFB141;
line-height:180%;
}
.tablelist tr.otherred{
background-color:#c00000;
line-height:180%;
}
-->
</style>
<script type="text/javascript" src="jstable.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<table id="table1" name="table1" bordercolor="#000000" width="700px" border="1" class="tablelist">
<thead>
<tr height="30px" >
<th width="20px"> </th>
<th width="20px"> </th>
<th>000000000000000000</th>
</tr>
</thead>
<tbody>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">1</td>
<td>0AAAAAAAAAA0</td>
</tr>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">2</td>
<td>0BBBBBBBBBB0</td>
</tr>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">3</td>
<td>0CCCCCCCCCC0</td>
</tr>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">4</td>
<td>0DDDDDDDDDD0</td>
</tr>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">5</td>
<td>0EEEEEEEEEEE0</td>
</tr>
<tr height="30px" id="otr" name="otr" class="other" onclick="poi.changeBackColor(this);">
<td width="20px">0</td>
<td width="20px">6</td>
<td>0FFFFFFFFFFFF0</td>
</tr>
</tbody>
</table>
<br><br>
<input type="button" name="moveup" onclick="poi.moveRowUp();" value="↑" />
<input type="button" name="movedown" onclick="poi.moveRowDown();" value="↓" />
<input type="button" name="movetop" onclick="poi.moveRowTop();" value="TOP" />
<input type="button" name="movebottom" onclick="poi.moveRowBottom();" value="BOTTOM" />
<script type="text/javascript">
var poi;
window.onload=function(){
poi = tableOPI(document.getElementById("table1"));
poi.setRowIndexColNum(1);//第一列显示行号
poi.setBackColorClass("other","other2");//非选中,选中样式
poi.unselectedCallBack = function() {
alert("请选择要移动的行!");
};
poi.resetRowIndex();
};
</script>
</body>
</html>
js操作table行的上下移动,置顶置底
需积分: 43 13 浏览量
2017-11-06
10:37:26
上传
评论
收藏 4KB RAR 举报
pdiddy
- 粉丝: 1
- 资源: 55
最新资源
- 基于SpringBoot Mybatis-Plus TypeScript的微服务多租户SaaS管理快速开发框架 .zip
- 论文复现:QA-GNN: Reasoning with Language Models and Knowledge
- ipp(intel-oneAPI)下载地址.txt
- 基于spring-boot dubbox搭建的java分布式系统的前端管理.zip
- VLC+Qt demoVLC+Qt demo
- 海彪&龙梅子 - 寂寞的人伤心的歌 (DJ版) [mqms2].ogg
- 530springboot + vue 旅游管理系统.zip(可运行源码+数据库文件+文档)
- 基于SpringBoot + Thymeleaf + Layui + Apache Shiro 的后台管理系统 .zip
- 表1:长江大学文理学院课外学分申请表.et
- base.apk
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈