php - 如何在表数据中有图像的 JQUERY 数据表中显示分页和搜索?
问题描述
这是我的桌身......
<section class="content">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title"></h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Category ID</th>
<th>Category Image</th>
<th>Category Name</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM `categories`";
$res_data = mysqli_query($con, $sql);
while ($row = mysqli_fetch_assoc($res_data)) {
// code...
?>
<tr>
<td><?php echo $row['Category_ID']; ?></td>
<td><?php echo "<img src=\"data:image;base64," . $row['Category_Image_Temp'] . "\" alt=" . $row['Category_Image_Name'] . " width=\"50px\" height=\"50px\">"; ?></td>
<td><?php echo $row['Category_Name']; ?></td>
<td><textarea><?php echo $row['Category_Name']; ?></textarea></td>
<td><a class="btn btn-info btn-sm" href="#">
<i class="fas fa-pencil-alt">
</i>
Update
</a></td>
<td><a class="btn btn-danger btn-sm" href="#">
<i class="fas fa-trash">
</i>
Delete
</a></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th>Category ID</th>
<th>Category Image</th>
<th>Category Name</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
因此,当我<td><?php echo "<img src=\"data:image;base64," . $row['Category_Image_Temp'] . "\" alt=" . $row['Category_Image_Name'] . " width=\"50px\" height=\"50px\">"; ?></td>
从代码中删除这一行时,只会出现分页和搜索。
主要问题是当我在数据表中显示图像时,不会出现分页和搜索。
当我在数据表中显示图像时,我想显示分页和搜索。
有人可以帮忙吗?谢谢....
解决方案
推荐阅读
- python-3.x - 我想以幻灯片的形式显示发送到特定文件夹的图像
- jenkins - 允许 Jenkins 用户在 Jenkins 上的特定 shell 脚本作业上运行 sudo 命令
- c - 将 getline() 输出保存到外部数组
- notepad++ - Notepad++ : 设置打开文件的特定编码
- sql - 在一列中拆分数据并将它们转换为 MS Access 中的列标题
- regex - Google RE2 的正则表达式测试器
- php - 警告:非法字符串偏移 'save_username'
- typescript - 如何在不重新捆绑新的 monaco-editor 的情况下将我自己的 monaco-typescript repo 分支集成到我的 monaco-editor vuejs webpack 设置中
- windows - Windows:关闭 32 位控制台应用程序时出现问题
- c++ - 我不理解移动构造函数的这种行为