<table id="example5" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
    <thead>
        <tr>
            <th>Sr.No</th>
            <!-- <th>Receipt No</th> -->
            <th>Narration</th>
            <th>Amount</th>
            <!-- <th>Payment Mode</th>
            -->
        </tr>
    </thead>
    <tbody>
        @php $i=1;
        
        @endphp
        @foreach($data as $result)
       
        <tr>
            <td>{{$i}}</td>
            <!-- <td>{{$result->id}}</td> -->
            <td>{{$result->Narration}}</td>
            <td>{{number_format($result->Amount,2)}}</td>
            <!-- <td>{{$result->PayMode}}</td> -->
          
        </tr>
        @php $i++;@endphp
        @endforeach
        <tr>
           
             <td>{{$i}}</td>
             <!-- <td></td> -->
             <th>Total </th>
             <th>{{number_format($sum,2)}}</th>
             <!-- <td></td> -->
           
        </tr>
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example5').DataTable({
        "scrollX": true,
        dom: 'Bfrtip',
        buttons: [

            'excelHtml5'

        ]
    });
});
</script>