read data
<?php
include("conn.php");
$result = $conn->query("select * from lyb limit 4");
while($row = $result->fetch_assoc()){
echo "<tr><td>" . $row["title"] ."<td/>";
echo "<td>" . $row["content"] ."<td/>";
echo "<td>" . $row["author"] ."<td/>";
echo "<td>" . $row["email"] ."<td/>";
echo "<td>" . $row["ip"] ."<td/></tr>";
};
?>
Show data
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="http://127.0.0.1/phpbook/jquery-3.3.1.min.js"></script>
<script>
$(function(){
$.get("p408.php",function(data){
$("-sharpdisp").append(data);
});
});
</script>
<h2 align="center">ajax</h2>
<table border="1" width="100%">
<tbody>
<tr id="disp">
<th></th>
<th></th>
<th></th>
<th>email</th>
<th>ip</th>
</tr>
</tbody>
</table>
</body>
</html>
as written above, the data is displayed as
table
how to make it display correctly line by line?