<table id="example6" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
        <thead>
            <tr>
            <th>Sr.No</th>
           <th>Date</th>
           <th>Amount</th>
          
            </tr>
        </thead>
        <tbody>
        @php $i=1;@endphp
        @foreach($data as $result)
        <tr>
             <td>{{$i}}</td>
             
             <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->CreatedDate)))}}</td>
         
            <td>{{number_format($result->Amount,2)}}</td>
            
        </tr>
        @php $i++;@endphp
        @endforeach

        <tr>
             <td>{{$i}}</td>
           
          
             <th>Total </th>
         
            <th>{{number_format($totsum,2)}}</th>
            
        </tr>
        </tbody>
    </table>
    <script type="text/javascript">
$(document).ready(function() {
    $('#example6').DataTable({
        "scrollX": true,
        dom: 'Bfrtip',
        buttons: [

            'excelHtml5'

        ]
    });
});
</script>