I have created a form to echo table data, I need to design the table With Sorting, Searching and Paging, but the error show me like this DataTables warning: Non-table node initialisation (DIV). For more information about this error, please see http://datatables.net/tn/2, below is my coding:
head
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css"></style>
<script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
Echo Table coding
<?php
session_start();
$qry = "select id, name, identify, created, pay_option, amount, receivedby from payment_details";
$_SESSION["query"] = $qry;
$result = $conn->query("select id, name, identify, created, pay_option, amount, receivedby from payment_details");
$rows = $result->fetchAll(PDO::FETCH_ASSOC);
echo "<div id='myTable'><div class='data-content'><span><b>REPORT SELECTION</b></span><div class='data-table'>";
echo "<table id='dataTable'><tr><th>Payer</th><th>Passport/IC No</th><th>Date Paid</th><th>Payment Type</th><th>Payment Amount</th><th>Received by</th><th>Payment Receipt</th></tr>";
foreach($rows as $row) {
echo "<tr id=".$row["id"]."><td>".$row["name"]."</td><td>".$row["identify"]."</td><td>".$row["created"]."</td><td>".$row["pay_option"]."</td><td>".$row["amount"]."</td><td>".$row["receivedby"]."</td><td><a href='?loc=invoice' onclick='sessionFunction(".$row["id"].")'>View</a></td></tr>";
}
echo "</table>";
echo "</div></div><div class='table-msg'><span>Total Record : ";
echo $result->rowCount();
echo "</span><span style='margin-left: 70%;'>Max 500 pages</span></div></div>";
?>
Script Function
$(document).ready(function(){
$('#myTable').dataTable();
});
Actual I want the output table like the below sample and red arrows in the picture mean that I want the function:

I hope someone coding experts can guide me how to sovle it, this problems have already make me stuck in the few days. Thanks.
