Coding Tips (JavaScript/CSS/VBA/Win32)

Useful code snippets, tips and some Windows applications
Use ProxyChanger 2.2
to change IE proxy settings

How To Search For Text in a HTML Table

The following function will find table cells containing the passed value and highlight those cells in red.
function search(tbl, val){
	if(val.length<1)
		return;
	for (var r=0;r < tbl.rows.length;r++) {
		var len=tbl.rows[r].cells.length;
		for(var c=0; c< len; c++){
			var text = tbl.rows[r].cells[c].innerHTML;
			if(text.indexOf(val)>-1)
				tbl.rows[r].cells[c].style.backgroundColor='red';
		}
	}
}

Usage example: search(document.getElementById("myTable"), "mytext");