Ctrl+/
IE11
F11
ESC
PgUp
PgDn
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery-表格的排序
</title>
<script type="text/javascript" src="http://ku.shouce.ren/libs/jquery/1/jquery1.8.0.min.js">
</script>
</head>
<body>
<table class="tabSort" width="546" height="300" border="0" align="center" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th scope="col">名称
</th>
<th scope="col">价格
xxxxxxxxxx
*{
margin:0px;
padding:0px;
}
table{
border-collapse:collapse;
table td{
border:1px solid #036;
text-align:center;
thead tr th{
cursor:pointer;
background:#066;
color:#FFFFFF;
thead tr th:hover{
background:#369;
$(function(){
//存入点击列的每一个TD的内容;
var aTdCont = [];
//点击列的索引值
var thi = 0
//重新对TR进行排序
var setTrIndex = function(tdIndex){
for(i=0;i<aTdCont.length;i++){
var trCont = aTdCont[i];
$("tbody tr").each(function() {
var thisText = $(this).children("td:eq("+tdIndex+")").text();
if(thisText == trCont){
$("tbody").append($(this));