我想在网格布局中的PHP表格中获取数据。所以我做了这个代码。我不知道出了什么问题,或者我错过了什么。我希望表格有三列,但它在单列中显示表格。任何帮助将不胜感激。php表格网格布局
下面是代码:
<html>
<head>
<title>PAGINATION FILTER</title>
</head>
<body>
<?php include 'conn.php';?>
<?php
$stmt=$con->prepare('SELECT author, book_name, language FROM bk_tst_fltr ORDER BY id LIMIT 8');
$stmt->execute();
$stmt->bind_result($author, $book_name, $language);
$stmt->store_result();
$i=0;
?>
<table border="1" cellpadding="10">
<?php
while($stmt->fetch()){
if($i % 3 == 0){
?><tr><td><?php echo $author,"\n</br>",$book_name,"\n</br>", $language ;?></td>
<?php
}}
?></tr></table>
</body>
</html>
非常感谢您解释的答案 – Kishore
如果我想在不使用表格的情况下使用div,我怎样才能做到这一点。因为我看到的每个网站都有这个div标签和一些li标签 – Kishore