gpt4 book ai didi

php - 在引导模式中打开表

转载 作者:行者123 更新时间:2023-11-29 19:01:17 25 4
gpt4 key购买 nike

我的页面上有一个表格。我想在模型中打开一个表格,以便在单击 td 时显示特定记录。下面是我的代码,我的问题是当我使用此代码模型成功打开但我的页表布局无法正确显示时。

<table class="table table-bordered table-striped mb-none" id="datatable-default">
<?php
$result=mysqli_query($con,"select * from class_review as a left join class_user_details as b on a.list_id = b.id group by list_id");
//$result=mysqli_query($con,"select * from class_review as a left join class_user_details as b on a.list_id = b.id left join class_users as c on a.user_id=c.id");
//echo "select * from class_review as a left join class_user_details as b on a.list_id = b.id left join class_users as c on a.user_id=c.id";
?>
<thead>
<tr>
<th>#</th>
<th>Shop Name</th>
<!--<th>User Name</th>-->
<th>Total Review </th>
<th>Average Rate</th>
<th>See All Review</th>
</tr>
</thead>
<tbody>
<?php $i=1;while($row=mysqli_fetch_array($result)) { ?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row['shop_name'] ; ?></td>
<?php $list_id=$row['list_id']; $query=mysqli_query($con,"SELECT count(*) from class_review where list_id=$list_id");
$fetch=mysqli_fetch_array($query); ?>
<td><?php echo $fetch[0] ; ?></td>
<td><?php echo $row['rate_point'] ; ?></td>
<td><a href="#" data-toggle="modal" data-target="#myModal1<?php echo $row['list_id'] ; ?>"><button type="button" class="btn btn-info">Reviews</button></td>
</tr>
<!--My Stuff start -->
<div id="myModal1<?php echo $row['list_id'] ; ?>" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body">
<table>
<thead>
<tr>
<th>#</th>
<th>User Name</th>
<th>Review </th>
<th>Average Rate</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>dd</td>
<td>ddd</td>
<td>ee</td>
<td>dfd</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button id="dialoge<?php echo $row['id'] ; ?>" class="btn btn-primary">Confirm</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<!--My Stuff end -->
<?php $i++; } ?>
</tbody>
</table>

最佳答案

你的模态表没有响应,请制作这样的结构

 <div class="table-responsive">
<table class="table table-bordered table-striped">

//rest of code

</table>

</div>

关于php - 在引导模式中打开表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43863253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com