parent
f5a2bc2e60
commit
98839c0811
6 changed files with 152 additions and 11 deletions
@ -0,0 +1,22 @@ |
||||
var people, asc1 = 1,asc2 = 1,asc3 = 1; |
||||
|
||||
function sort_t(tbody, col, asc){ |
||||
var rows = tbody.rows, rlen = rows.length, arr = new Array(), i, j, cells, clen; |
||||
// fill the array with values from the table
|
||||
for(i = 0; i < rlen; i++){ |
||||
cells = rows[i].cells; |
||||
clen = cells.length; |
||||
arr[i] = new Array(); |
||||
for(j = 0; j < clen; j++){ |
||||
arr[i][j] = cells[j].innerHTML; |
||||
} |
||||
} |
||||
// sort the array by the specified column number (col) and order (asc)
|
||||
arr.sort(function(a, b){ |
||||
return (a[col] == b[col]) ? 0 : ((a[col] > b[col]) ? asc : -1*asc); |
||||
}); |
||||
for(i = 0; i < rlen; i++){ |
||||
arr[i] = "<td>"+arr[i].join("</td><td>")+"</td>"; |
||||
} |
||||
tbody.innerHTML = "<tr>"+arr.join("</tr><tr>")+"</tr>"; |
||||
} |
@ -0,0 +1,34 @@ |
||||
.freeze{ |
||||
height: 50px; |
||||
line-height: 60%; |
||||
padding: 4px 16px; |
||||
} |
||||
#sprite { |
||||
image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */ |
||||
image-rendering: -moz-crisp-edges; /* Firefox */ |
||||
image-rendering: -o-crisp-edges; /* Opera */ |
||||
image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ |
||||
image-rendering: pixelated; /* Chrome */ |
||||
image-rendering: optimize-contrast; /* CSS3 Proposed */ |
||||
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */ |
||||
width: 50%; |
||||
height: auto; |
||||
} |
||||
table { |
||||
border-collapse: collapse; |
||||
border: none; |
||||
position: relative; |
||||
top: 60px; |
||||
} |
||||
th, |
||||
td { |
||||
border: 1px solid black; |
||||
padding: 4px 16px; |
||||
font-family: "Courier New", Courier, monospace; |
||||
font-size: 16px; |
||||
text-align: left; |
||||
} |
||||
th { |
||||
background-color: #C8C8C8; |
||||
cursor: pointer; |
||||
} |
Loading…
Reference in new issue