Lines Matching refs:table
10 Add class="sortable" to any table you'd like to make sortable
34 forEach(document.getElementsByTagName('table'), function(table) {
35 if (table.className.search(/\bsortable\b/) != -1) {
36 sorttable.makeSortable(table);
42 makeSortable: function(table) {
43 if (table.getElementsByTagName('thead').length == 0) {
44 // table doesn't have a tHead. Since it should have, create one and
45 // put the first table row in it.
47 the.appendChild(table.rows[0]);
48 table.insertBefore(the,table.firstChild);
50 // Safari doesn't support table.tHead, sigh
51 if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
53 if (table.tHead.rows.length != 1) return; // can't cope with two header rows
60 for (var i=0; i<table.rows.length; i++) {
61 if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
62 sortbottomrows[sortbottomrows.length] = table.rows[i];
66 if (table.tFoot == null) {
67 // table doesn't have a tfoot. Create one.
69 table.appendChild(tfo);
78 headrow = table.tHead.rows[0].cells;
87 headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
91 headrow[i].sorttable_tbody = table.tBodies[0];
96 // reverse the table, which is quicker
109 // re-reverse the table, which is quicker
166 guessType: function(table, column) {
169 for (var i=0; i<table.tBodies[0].rows.length; i++) {
170 text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
380 // create a hash table of event types for the element
382 // create a hash table of event handlers for each element/event pair
391 // store the event handler in the hash table
404 // delete the event handler from the hash table
415 // get a reference to the hash table of event handlers