<table id="example" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
    <thead>
        <tr>
            
            <th>Mrd. No</th>
            <th>Patient Name</th>
            <th>Phone</th>
            <th>Address</th>
            <th>Eye</th>
            <th>Diagnosis</th>
        </tr>
    </thead>
    <tbody>
        @foreach($data as $result)
        <tr>
         
             <td>{{$result->MrdNo}}</td>
             <td>{{$result->PatientName}}</td>
             <td>{{$result->Phone}}</td>
             <td>{{$result->Address}}</td>
             <td>{{$result->Eye}}</td>
             <td>{{$result->Diagnosis}}</td>
        </tr>
        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
      "scrollX": true,
        dom: 'Bfrtip',
        buttons: [
            
            'excelHtml5'
           
        ]
    });
});
</script>