Hi Jrobles,
You might wanna consider the script that I use for my website to generate a dynamic table. As for pagination, I'm afraid you would have to seek help in other tutorials because I haven't included that in my website yet.
<?php
//Setting up connection and selecting database//
include "connection.php";
//Defining array holders//
$item_id = array();
$item_image = array();
$item_name = array();
$item_colour = array();
$item_price = array();
$item_account = array();
$item_category = array();
$item_likes = array();
//Defining how many cells to show ($length; you can set it or let it figure out how many to show, see below) and how many per row ($itemperrow)
if(!isset($itemperrow))
$itemperrow = 5;
if(isset($length))
$length = $length + 1;
//Get information needed from database//
$sql = "SELECT * FROM item ORDER BY item_likes DESC";
$results = mysql_query($sql,$con);
$length = mysql_affected_rows() + 1;
//Loop cell generation, I don't start with $i=0 because there will be a problem when you want to end the row, see all the way below
echo('<table><tr>');
for($i=1;$i<$length;$i++)
{
$row = mysql_fetch_array($results);
$item_id[$i] = $row['item_id'];
$item_name[$i] = $row['item_name'];
$item_colour[$i] = $row['item_colour'];
$item_price[$i] = $row['item_price'];
$item_account[$i] = $row['item_account'];
$item_category[$i] = $row['item_category'];
$item_likes[$i] = $row['item_likes'];
$imageid = $row['item_img'];
//Selecting the corresponding image from image table (I store my images of product in another table, which is why I need the code below, feel free to alter the code to suit how you store your images
$sql = "SELECT * FROM image WHERE image_id = '$imageid'";
$result = mysql_query($sql,$con);
$row = mysql_fetch_array($result);
$grabpath = $row['image_path'];
$item_image[$i] = $grabpath;
//Selecting the account id from account table, as I want to display who uploaded it
$sql = "SELECT * FROM account WHERE account_name = '$item_account[$i]'";
$result = mysql_query($sql,$con);
$row = mysql_fetch_array($result);
$account_id = $row['account_id'];
//This is the important cell generation part, tweak the HTML according to what you want
echo('<td><a href="item.php?id=' . $item_id[$i] . '"><img src="' . $item_image[$i] . '" id="image" onload="resize(\'image\')" /></a></td>');
//Detects if a new row needs to be created, using the modulus function to find if there is any remainder. Eg. 3 divide by 3 (the function has generated the 3rd cell, the itemperrow is 3, so the next cell should be on a new row. Remainder gives 0, thus echo out a new row
if($i%$itemperrow==0)
{echo('</tr><tr>');}
}
//End of the demonic table
echo('</tr></table>');
?>
I hope this helps. As for the width etc etc, I would suggest that you use a CSS spreadsheet to define all these as it will make the whole code easier to work with.
Cheers!