Working on this for school and trying to split my PHP table being displayed on a website using HTML into to different pages. How do I do it?
Below is the code I’m working with. It would be preferable if there was a little page indicator at the bottom of the code that users could use to switch between table pages.
<div class="container mt-4">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h4>Current Active Orders
</h4>
</div>
<div class="card-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Site Name</th>
<th>Unit Number</th>
<th>Street Number</th>
<th>Street Name</th>
<th>Street Type</th>
<th>Suburb</th>
<th>Post Code</th>
<th>Nubmer of Pools</th>
<th>Local Goverment Authority</th>
<th>Shared Pool</th>
</tr>
</thead>
<tbody>
<?php
require('conn.php');
$query = "SELECT * FROM norm_pool";
$result = mysqli_query($conn, $query);
if(mysqli_num_rows($result) > 1)
{
while($row = $result->fetch_assoc())
{
?>
<tr>
<td><?= $row['ID']; ?></td>
<td><?= $row['sitename']; ?></td>
<td><?= $row['unitno']; ?></td>
<td><?= $row['streetno']; ?></td>
<td><?= $row['streetname']; ?></td>
<td><?= $row['streettype']; ?></td>
<td><?= $row['suburb']; ?></td>
<td><?= $row['postcode']; ?></td>
<td><?= $row['noofpools']; ?></td>
<td><?= $row['localgovauth']; ?></td>
<td><?= $row['sharedpool']; ?></td>
</tr>
<?php
}
}
else
{
echo "<h5> No Users Found </h5>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>