$("#tableData tbody tr").each(function(i,n){ if($(this).find("td:nth-child(4)").text()>0){ $(this).find("td:last").append(' '+ '<i class="fa fa-long-arrow-up" style="color:red;"></i>'); }else{ $(this).find("td:last").append(' '+ '<i class="fa fa-long-arrow-down" style="color:#03a403;"></i>'); } })
若是最後列的內容爲正數追加上升圖標,若是爲負數追加降低圖標javascript