filter and remove

filter and remove

I want to filter data by company, by amount and show only the last row in column dollar and peso. 

please see screenshot, the data will be based in database.

here's my html tag 

  1. echo "<tr>
  2. <td>".$r['Name']."</td>
  3. <td align='center'>".$r['date']."</td>
  4. <td align='right'>".number_format($r['NetDollarPayOutReplenishment'], 2)."</td>                 <td align='center'>".number_format($r['NetShare'], 2)."</td>
  5. <td align='right'>".number_format($r['NetPesoReplenishmentLOC'], 2)."</td>
  6. <td align='right'>".number_format($r['NetPesoReplenishmentUSD'], 2)."</td>
  7. <td align='center'>".$date3."</td>
  8. <td align='right' class='forDepositDollar' id='$ForDepDollar'>".@number_format($ForDepDollar, 2)."</td>
  9. <td align='right' class='forDepositPeso'>".@number_format($ForDepPeso, 2)."</td>
  10. <td>&nbsp;</td>
  11. </tr> ";
heres my js code 


  1. var DollarDepositArray = <?php echo json_encode($arrayForDollarDeposit);  ?>
  2. for ( var i = 0; i < DollarDepositArray.length; i = i + 1 ) {
  3.  var item = DollarDepositArray[i]
  4.   
  5.  // console.log(item)

  6.      $("td.forDepositDollar[id='"+item+"']").filter(function() { 
  7.            return $(this).text() == item
  8.      }).not(':last').css("background-color","yellow");
  9.                   // .not(':last').remove()
  10.       
  11. }
my problem is I cannot get the right value of my id attribute, only 0.00 are getting, second one is I cannot get and remove the values in the column dollar and peso,

thanks