如何使用html创建可分页网格

I am pulling some data from mysql database using PHP, now I would like to place that data in a html table which I have completed, how can I make the table pageable if it goes over say 10 records? Is there a tutorial I can look into or any information where I can get this? Maybe a tool I can implement easily? I just haven't found anything online about this topic but perhaps anyone here can lead me in the correct direction

I am currently using just a simple <table></table> html

You can achieve paging with MySQL's LIMIT keyword. You can then use a query string to tell the website which page to get.

First we need to set a default page number and define how many results we want to display in the page:

$items_per_page = 10;

$page = 1;

if(isset($_GET['page'])) {
    $page = (int)$_GET['page'];
}

The LIMIT keyword works by providing an offset and the number of rows you want to limit to. So now we need to figure out the offset:

$offset = ($page - 1) * $items_per_page;

Now we have all of the information we need to limit the results correctly based on the page number in our query string:

$query = "SELECT column_1, column_2 FROM your_table LIMIT {$offset}, {$items_per_page};";
$result = mysql_query($query) or die('Error, query failed');

while($row = mysql_fetch_assoc($result)) {
   echo $row['column_1'] . '<br />';
}

Now to show your different pages you just add the query string to the end of your page URI.

For example my_page.php?page=1 or my_page.php?page=2

Perhaps you could try to figure out how to create the paging links by yourself and post more if you can't get it to work.

You just need to find out the total rows in your query with COUNT in MySQL and you can do all of the maths from there ;)

You'll need some javascript in order to do paging..

Take a look at http://flexigrid.info/

In summary, what you should do is have your php script return the tabular data as JSON or XML, and then feed it to flexgrid.

You can also have flexgrid request records when they're needed using additional requests.