<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<title>表格</title>
<style type="text/css">
.editText
{
border-width:1px;
border-top-style:none;
border-left-style:none;
border-right-style:none;
border-bottom-style:solid;
border-color:#030;
width:100%;
}
</style>
<script src="jquery-1.3.2.js" type="text/javascript">
</script>
<script type="text/javascript">
function moveUp(obj)
{
var current=$(obj).parent().parent();
var prev=current.prev();
if(prev)
{
current.insertBefore(prev);
}
}
function moveDown(obj)
{
var current=$(obj).parent().parent();
var next=current.next();
if(next)
{
current.insertAfter(next);
}
}
</script>
</head>
<body>
<table class="grid" width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>字段英文名</td>
<td>字段中文名</td>
<td>字段数据类型</td>
<td>列宽</td>
<td>是否显示</td>
<td>是否作为查询条件</td>
<td>调整顺序</td>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="textfield" class="editText" id="textfield"></td>
<td> </td>
<td><input type="text" name="textfield5" id="textfield5"></td>
<td><input type="checkbox" name="checkbox" id="checkbox"></td>
<td><input type="checkbox" name="checkbox5" id="checkbox5"></td>
<td><a href="javascript:void(0)" onClick="moveUp(this)">上移</a><a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
</tr>
<tr>
<td>2</td>
<td><input type="text" name="textfield2" id="textfield2"></td>
<td> </td>
<td><input type="text" name="textfield6" id="textfield6"></td>
<td><input type="checkbox" name="checkbox2" id="checkbox2"></td>
<td><input type="checkbox" name="checkbox6" id="checkbox6"></td>
<td><a href="javascript:void(0)" onClick="moveUp(this)">上移</a><a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
</tr>
<tr>
<td>3</td>
<td><input type="text" name="textfield3" id="textfield3"></td>
<td> </td>
<td><input type="text" name="textfield7" id="textfield7"></td>
<td><input type="checkbox" name="checkbox3" id="checkbox3"></td>
<td><input type="checkbox" name="checkbox7" id="checkbox7"></td>
<td><a href="javascript:void(0)" onClick="moveUp(this)">上移</a><a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
</tr>
<tr>
<td>4</td>
<td><input type="text" name="textfield4" id="textfield4"></td>
<td> </td>
<td><input type="text" name="textfield8" id="textfield8"></td>
<td><input type="checkbox" name="checkbox4" id="checkbox4"></td>
<td><input type="checkbox" name="checkbox8" id="checkbox8"></td>
<td><a href="javascript:void(0)" onClick="moveUp(this)">上移</a><a href="javascript:void(0)" onClick="moveDown(this)">下移</a></td>
</tr>
</table>
</body>
</html>
posted on 2012-03-22 12:02
hellxoul 阅读(2072)
评论(0) 编辑 收藏 所属分类:
JavaScript