<table id="example" class="table table-striped table-bordered" style="width:100%">
    <thead>
        <tr>
            <th>Mrd. No</th>
            <th>Patient Name</th>
            <th>Age/Gender</th>
            <th>Visit Date</th>
            <th>In Time</th>
            <th>Out Time</th>
            <th>Stay Time</th>
          
        </tr>
    </thead>
    <tbody>
        @foreach($data as $result)
        <tr>
        
             <td>{{$result->MrdNo}}</td>
             <td>{{$result->PatientName}}</td>
             <td>{{$result->Age}}/{{$result->Gender}}</td>
             <td>{{date("d/m/Y", strtotime(str_replace('-', '/',$result->InDate)))}}</td>
             <td>{{date("h:i a", strtotime(str_replace('-', '/',$result->InTime)))}}</td>
             <td>{{date("h:i a", strtotime(str_replace('-', '/',$result->OutTime)))}}</td>
             <td>{{$result->AvgTime}}</td>
            
          
        </tr>
        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
      "scrollX": true,
      "pageLength":50,
        dom: 'Bfrtip',
        buttons: [
            
            'excelHtml5'
           
        ]
    });
});
</script>