<table id="example" class="table table-striped table-bordered" style="width:100%">
    <thead>
        <tr>
        <th>Sr. No</th>
            <th>Mrd. No</th>
            <th>Patient Name</th>
            <th>Surgery Date</th>
            <th>IOL Power</th>
            <th>Opto Name</th>
        
            
        </tr>
    </thead>
    <tbody>
        @php $i=1;@endphp
        @foreach($data as $result)
        <tr>
        <td>{{$i}}</td>
             <td>{{$result->MrdNo}}</td>
             <td>{{$result->PatientName}}</td>
             <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->CreatedDate)))}}</td>
             
             <td>{{$result->IolPower}}</td>
             <td>{{$result->OptoName}}</td>
             
            
            
          
        </tr>
        @php $i++;@endphp
        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
      "scrollX": true,
      "pageLength":50,
        dom: 'Bfrtip',
        buttons: [
            
            'excelHtml5'
           
        ]
    });
});
</script>