HI,
i have the the javascript for filter but it will delete's the remaining rows
i dont want to delete the remaining code
function filter(term, _id, cellNr) {
var suche = term.value.toLowerCase();
var table = document.getElementById(_id);
var ele;
for (var r = 1; r < table.rows.length; r++) {
ele = table.rows[r].cells[cellNr].
if (ele.toLowerCase().indexOf(
table.rows[r].style.display = '';
}
else {
table.rows[r].style.display = 'none';
}
}
Please modify the java script for filtering the html table
For ex: My table
Column 1 column2 A vini B Kiru c vini D Loki
if my key word is vini
then result should be in this way (i.e first rows should be the key word and followed by other words)
Column 1 column2 A vini c vini B kiru D Loki or please suggest me any other solution for this problem
Anil KumarPosted May 11, 2012, 5:12 AM
http://blog.echarp.org/filterTable
Or you may like jQuery to do this job. jQuery complete code with description can be refer in -
http://net.tutsplus.com/tutorials/javascript-ajax/using-jquery-to-manipulate-and-filter-data/
If you like, go for any pluginn/tool available free.
http://www.javascripttoolbox.com/lib/table/