My Table will not initialize.

My Table will not initialize.

epesSteveepesSteve Posts: 1Questions: 1Answers: 0

My table will not initialize anymore. It dod when I started but as I have made changes to the dynamic input for the tables it quit working. I stripped it down to the bare minimum of information in the tables with no formatting and it doesn't initialize.
Please help.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--Style Sheets-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<!--js links-->
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!--table sorting scripts-->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.22/css/dataTables.bootstrap4.min.css">
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.22/js/dataTables.bootstrap4.min.js"></script>
<!--Font links-->
<link href="https://fonts.googleapis.com/css?family=Lusitana&display=swap" rel="stylesheet">
<title>Enroll Voters</title>
</head>

<body>
<div class="table-responsive">
<table id="info2" class="table table-striped table-bordered w-auto small">
<thead>
<tr>
<th>Husband</th>
<th>Select <br>Voter</th>
<th>Wife</th>
<th>Select <br>Voter</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($eligVoters AS $rowEV) { ?>
<tr>
<td><?php echo $rowEV['ln'] .", " .$rowEV['fn'] ."<br>" .$rowEV['email']; ?></td>
<td>
<?php if ($rowEV['hPos'] == 1) {
echo "<span class='text-danger'>Enrolled</span>";
} else {
echo "<a href='eventVoteEnrollSubmit.php?eid=" .$eid ."&sTuid=" .$rowEV['tuid'] ."&pos=1&type=1'>Online</a>
<br><br>
<a href='eventVoteEnrollSubmit.php?eid=" .$eid ."&sTuid=" .$rowEV['tuid'] ."&pos=1&type=0'>In Person</a>";
}?>
</td>
<td><?php echo $rowEV['ln2'] .", " .$rowEV['fn2'] ."<br>" .$rowEV['email2']; ?></td>
<td>
<?php if ($rowEV['wPos'] == 2) {
echo "<span class='text-danger'>Enrolled</span>";
} else {
echo "<a href='eventVoteEnrollSubmit.php?eid=" .$eid ."&sTuid=" .$rowEV['tuid'] ."&pos=1&type=1'>Online</a>
<br><br>
<a href='eventVoteEnrollSubmit.php?eid=" .$eid ."&sTuid=" .$rowEV['tuid'] ."&pos=1&type=0'>In Person</a>";
}?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#info2').DataTable({
"pageLength":50
});
} );
</script>
</div><!--end table section-->
</body>

</html>

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    If the Datatable formatting is gone then that is likely due to a Javascript error stopping the script. Look in the browser's console for errors.

    Kevin

Sign In or Register to comment.