table_max_char_length_browser_console.js
// en yüksek karakter sayılı eleman jquery table td
var findMaxCharTable = function(_coloumn,_tableId) // kaçıncı satırda arama olcak ve table idsi.
{
var max = 0;
var ind = 0;
var row = 0;
var outp = "";
var outp2 = "";
var outp3 = "";
var clmn = _coloumn;
var _table = "";
if(_tableId != "" && _tableId != undefined) _table = "#"+_tableId;
var list = $(_table+" tbody").find("td");
var thd = $(_table+" thead").find("th");
var ln = thd.length;
var inc=1;
var indx;
if(clmn != "" && clmn != undefined)
{
inc = ln;
}
else
{
clmn = 1;
}
for(var b = (clmn-1) ;b<list.length;b++)
{
if(max<=($(list[b]).html().trim().length))
{
max = $(list[b]).html().trim().length;
ind = b;
}
b = b + inc - 1;
};
console.log();
row = Math.ceil(ind/(ln));
outp = row+1;
outp2 = $(thd[0]).html();
for (var i = 1; i < ln; i++) {
outp2 += " - " + $(thd[i]).html();
}
indx = (ind%ln)+1;
var eleman = $(list[ind]).html();
$(list[ind]).html("["+eleman.trim()+"]");
outp3 = $(list[ind-indx+1]).html();
for (var i = 1; i < ln; i++) {
outp3 += " - " + $(list[ind-indx+i+1]).html();
}
$(list[ind]).html(eleman);
return { row:outp,coloumnName: outp2,result:outp3 };
}