Skip to content

Instantly share code, notes, and snippets.

@shohag-cse-knu
Created September 10, 2018 12:04
Show Gist options
  • Save shohag-cse-knu/bc1fb2131e1f7ba8a3f37dc020a1649e to your computer and use it in GitHub Desktop.
Save shohag-cse-knu/bc1fb2131e1f7ba8a3f37dc020a1649e to your computer and use it in GitHub Desktop.
jQuery table row traversing without first row and last row
jQuery('#showFacilityBox .showTr:not(:first-child)').each(function(){ //:not(:last-child)
if(!jQuery(this).is(":last-child")){
if(this.cells[5].innerHTML == inner_outer)
{
var amount_bdt = (this.cells[6].innerHTML).replace(/,/g, "");
if(amount_bdt.charAt(0)=='(')
{
amount_bdt = amount_bdt.slice(0, -1);
amount_bdt = amount_bdt.substr(1);
}
total_bdt = parseFloat(total_bdt) + parseFloat(amount_bdt);
var amount_usd = (this.cells[7].innerHTML).replace(/,/g, "");
if(amount_usd.charAt(0)=='(')
{
amount_usd = amount_usd.slice(0, -1);
amount_usd = amount_usd.substr(1);
}
total_usd = parseFloat(total_usd) + parseFloat(amount_usd);
}
}else
{
jQuery(this).find('td:eq(1)').html("<strong>"+total_bdt+"</strong>");
jQuery(this).find('td:eq(2)').html("<strong>"+total_usd+"</strong>");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment