【发布时间】:2018-06-28 22:45:38
【问题描述】:
我创建了一个包含数据库值的 HTML 表
<?php
include 'conexao.php';
echo "<div id='table'>
<table >
<tr>
<th class='first'>Selecione</th>
<th>Mês</th>
<th>Valor</th>
</tr>";
$result = mysql_query('SELECT * FROM cpf');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
while($row = mysql_fetch_array( $result )) {
echo "<tr>
<td class='first'><input type='radio' name='selecione'/></td>
<td>". $row['mes'] ."</td>
<td>". number_format($row['valor'], 2, ',', '.') ."</td>
</tr>";
}
echo "</table></div>";
?>
嗯,它很好用,但是当我有很多值时,我必须向下滚动页面。例如,当我有超过 10 个值时,我想为我的表创建“页码”。
类似这样的:http://www.phpgrid.org/demo-center/
观察:我不想像链接中的表格那样完成表格,因为我想将我的样式应用于表格......
有人可以帮我吗?
【问题讨论】:
-
我认为你需要在 php 中进行分页
标签: php mysql html-table