I am in need of help displaying a table using javascript in a php block. Below is the code I have:
?>
<script type="text/javascript">
$(document).ready(function() {
$('#pain').dataTable( {
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": true
}
);
} );
</script>
<?php
$client = $_COOKIE['memberID'];
echo '<br><table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="pain">
<thead>
<tr>
<th>PainWhere</th>
<th><strong>PainDescribe</strong></th>
<th><strong>Severity</strong></th>
<th><strong>Current</strong></th>
</tr>
</thead>
<tbody><tr>
<td>
$PainWhere</td>
<td>
$PainDescribe</td>
<td>
$Severity</td>
<td>
$Current</td>
</tr>';
echo '</table>';
but it is not displaying properly. Pics attached. I want to use the installed jquery for my datatables, but the way I have it working on my custom page is not working in a php block.
First pic is of the page that is not working with code above. 2nd page is page that is working, but I added the javascript call to a custom page. Any help would be greatly appreciated. Thanks in advance.