2017-05-09 82 views
0

我在我的頁面上有一個表格。我想在模型中打開表格以顯示特定記錄,當我點擊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> 

回答

0

你的情態表沒有響應,作出這樣

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

    //rest of code 

    </table> 

</div> 
+0

@ this.grish的結構仍然沒有工作時,我就可以使一個小提琴響應班組長 –

+0

使用? –

+0

@ thsi.grish當我使用模式代碼的循環這一方面運行良好,但它是強制性保持循環。 –