【发布时间】:2020-01-21 20:13:54
【问题描述】:
我在 template.php 中得到了带有“查看”按钮的下表。我正在使用引导程序 3.3.7
<?php
if($num>0){
echo "<table class='table table-responsive table-sm table-hover table-bordered'>";
echo "<thead>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Description</th>";
echo "<th></th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
echo "<tr>";
echo "<td>{$name}</td>";
echo "<td>{$description}</td>";
echo "<td>";
echo "<a href='view_thing.php?id={$id}' class='btn-info btn-sm'>";
echo "<span class='glyphicon glyphicon-eye-open'></span> View";
echo "</a>";
echo "</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
?>
看起来像: table test 1
我尝试了什么:
<th class="col-md-1"></th>
<th style="width: 10%"></th>
应该怎么做:
最后一列应该适合按钮大小。
【问题讨论】:
标签: php mysql twitter-bootstrap-3 html-table