Do you mean some thing like "example 1" from here (https://www.php.net/manual/en/mysqli-result.fetch-assoc.php)?
You only need to add the html tags to create the html table (table, td, ...).
EDIT:
This example includes the html tags and should do what you want:
<html>
...
<body>
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "database");
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = $mysqli->query($query)) {
echo "<table>";
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row['Name'] . "</td><td>" . $row['CountryCode'] . "</td></tr>";
}
echo "</table>";
/* free result set */
$result->free();
}
?>
</body>