<table class="table table-bordered">
<thead><tr><th>Code</th><th>Area</th><th>Rate</th><th>Action</th></tr></thead>

<tbody>
    <?php foreach($list as $u){?>
<tr><td><?php echo $u->area_code;?></td>
<td><?php echo $u->area_name;?></td>
<td><?php echo $u->rate_fee;?></td>
<td><a href="#" id="<?php echo $u->rate_id;?>" class="btn btn-sm btn-danger rate_delete"><i class="fa fa-trash"></i></a></td></tr>
    <?php }?>
</tbody>
</table>
<script>
		$(document).ready(function(){
            $(".rate_delete").click(function(e){e.preventDefault();
		        if (!confirm("Sure you want to delete?")){
				  return false;
				}
			var id=$(this).attr("id");
            $(this).closest("tr").remove();
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/ajax_rate_delete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		    });
		});
</script>