Here's an example of how you get it to work with a standard DataAssist recordset.
<!--Give your table an id and include thead and tbody tags-->
<table id="myTable" >
<thead>
<tr>
<th>Lender</th>
<th>Adviser</th>
<th>Client</th>
</tr></thead>
<tbody>
<!--Create one row to display details from your recordset, then wrap the mySQLi repeat region behavior around the row-->
<?php
$wa_startindex = 0;
while(!$rsDetails->atEnd()) {
$wa_startindex = $rsDetails->Index;
?>
<tr>
<td><?php echo($rsDetails->getColumnVal("Lender")); ?></td>
<td><?php echo($rsDetails->getColumnVal("Adviser")); ?></td>
<td><?php echo($rsDetails->getColumnVal("Client")); ?></td>
</tr>
<?php
$rsDetails->moveNext();
}
$rsDetails->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
</tbody>
</table>
Then include jQuery and the standard DataTables script in the head section and initialise your table:
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.css" />
<script src="https://cdn.datatables.net/2.0.3/js/dataTables.js"></script>
<script>
$(document).ready( function () {
$('#myTable').DataTable();
} );
</script>