how can export data in excel file custom plugin

<script src=”https://wordpress.stackexchange.com/questions/355504/<?php echo plugins_url();?>/client/jquery.js”></script> <button id=”excel” onClick =”$(‘#dataTable’).tableExport({type:’excel’,escape:’false’});”> XLS</button> <button id=”print”>Print me</button> <table class=”dash-table” width=”100%” cellspacing=”0″ cellpadding=”10px” border=”0″ id=”dataTable”> <tr> <td>Client Name</td> <td>Email</td> <td>Health Condition</td> <td>Changes</td> <td>Image</td> </tr> <?php foreach ($results1 as $key => $value) { ?> <tr> <td><?php echo $value->rclient_name;?></td> <td><?php echo $value->email;?></td> <td><?php echo $value->health_condition;?></td> <td><?php echo $value->changes;?></td> <td><img src=”https://wordpress.stackexchange.com/questions/355504/<?php echo $value->image;?>” width=”50px” … Read more