ok so i have this code for a table.
$idUser = $_SESSION['id'];
$query = "SELECT b.*, c.name FROM bookings b JOIN user c ON b.userId=c.userId WHERE b.date >=CURDATE() and isdelete=0";
$result = mysqli_query($link, $query);
if (mysqli_num_rows($result) > 0) {
    while ($row = mysqli_fetch_assoc($result)) {
        echo '<tr>';
        echo '<td>' . $row['id'] . '</a></td>';
        echo '<td>' . $row['date'] . '</td>';
        echo '<td>' . $row['start'] . '</td>';
        echo '<td>' . $row['name'] . '</td>';
        if($row['isPayed']==0){
          echo '<td>Blom Lunas</td>';
        }
        else{
          echo '<td>Sudah Lunas</td>';
        }
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="6">No data in table</td></tr>';
}
echo '</table>';
how can i import this table into excel when i click a button bellow the table.