I have a table here: http://www.theafricangreyparrot.com/breeders.php which changes shape depending on the data put into the database. I want the columns to stay at a fixed pixel size. How can I do this? The problem is that the "name and address" column is getting too squashed because of the information in the "description" column. Thanks inadvance Notting <?php require_once('Connections/breeder.php'); ?> <?php $maxRows_rstbreeder = 10; $pageNum_rstbreeder = 0; if (isset($_GET['pageNum_rstbreeder'])) { $pageNum_rstbreeder = $_GET['pageNum_rstbreeder']; } $startRow_rstbreeder = $pageNum_rstbreeder * $maxRows_rstbreeder; mysql_select_db($database_breeder, $breeder); $query_rstbreeder = "SELECT * FROM breederdetails WHERE breederdetails.active = 'y' ORDER BY breederdetails.country"; $query_limit_rstbreeder = sprintf("%s LIMIT %d, %d", $query_rstbreeder, $startRow_rstbreeder, $maxRows_rstbreeder); $rstbreeder = mysql_query($query_limit_rstbreeder, $breeder) or die(mysql_error()); $row_rstbreeder = mysql_fetch_assoc($rstbreeder); if (isset($_GET['totalRows_rstbreeder'])) { $totalRows_rstbreeder = $_GET['totalRows_rstbreeder']; } else { $all_rstbreeder = mysql_query($query_rstbreeder); $totalRows_rstbreeder = mysql_num_rows($all_rstbreeder); } $totalPages_rstbreeder = ceil($totalRows_rstbreeder/$maxRows_rstbreeder)-1; ?> <html> <head> <meta http-equiv="Content-Language" content="en-gb"> <title>African Grey Parrot - Breeders</title> <META NAME="keywords" CONTENT="african grey parrot, african grey parrots"> <META NAME="description" CONTENT="African Grey Parrot information, guide, articles, care, buying guide and community"> <META NAME="Theafricangreyparrot.co.uk" CONTENT="manager@theafricangreyparrot.co.uk"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta http-equiv="Content-Language" content="en-gb"> <link rel="shortcut icon" href="/favicon.ico" /> <link rel="stylesheet" type="text/css" href="style.css"> <style type="text/css"> <!-- .style2 { color: #FF0000; font-weight: bold; } --> </style> </head> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-265014-1"; urchinTracker(); </script> <script type="text/javascript" src="http://cetrk.com/pages/scripts/0004/8763.js"> </script> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- PAGE TABLE; BEGIN --> <table width="752" border="0" cellpadding="0" cellspacing="0" align="center"> <tr valign="top"> <td> <!-- HEADER TABLE; BEGIN --> <table width="750" border="0" cellpadding="0" cellspacing="0"> <form method="POST" action="_vti_bin/shtml.exe/African-Grey-Parrot-Articles.html" onSubmit="" webbot-action="--WEBBOT-SELF--"> <!--webbot bot="SaveResults" S-Email-Address="manager@theafricanparrot.com" S-Email-Format="TEXT/PRE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" i-checksum="43374" endspan --> <tr> <td colspan="3"> <a href="/index.html"> <img src="images/home_button.gif" width="51" height="16" border="0" alt=""></a></td> <td colspan="5"> <a href="javascript:window.external.AddFavorite('http://www.theafricangreyparrot.com','Theafricangreyparrot.com')"> <img src="images/favourites_button.gif" width="94" height="16" border="0" alt=""></a></td> <td colspan="4"> <img src="images/header_01.gif" width="371" height="16" alt=""></td> <td rowspan="2"> <img src="images/header_03.gif" width="31" height="22" alt=""></td> <td rowspan="2"> <img src="images/header_search.gif" width="62" height="22" alt=""></td> <td colspan="2" rowspan="2" background="images/header_search_background.gif"> <img src="images/spacer.gif" width="96" height="1" alt=""><br> <input type="text" size="15" name="search" value="" class="forminputsmall"></td> <td rowspan="2"> <input type="image" src="images/search_button.gif" width="22" height="22" alt="Go"></td> <td rowspan="2"> <img src="images/header_04.gif" width="23" height="22" alt=""></td> </tr> </form> <tr> <td colspan="12"> <img src="images/header_02.gif" width="516" height="6" alt=""></td> </tr> <tr> <td colspan="18"> <a href="/index.html"><img src="images/header_image.gif" alt="African Grey Parrot" width="750" height="84" border="0"></a></td> </tr> <tr> <td colspan="9"> <img src="images/header_05.gif" width="166" height="22" alt=""></td> <td> <a href="/African-Grey-Parrot-Bio.html"> <img src="images/button_1.gif" width="116" height="22" border="0" alt="African Grey Parrot Bio"></a></td> <td> <a href="/African-Grey-Parrot-Care.html"> <img src="images/button_2.gif" width="117" height="22" border="0" alt="African Grey Parrot Care"></a></td> <td> <a href="/African-Grey-Parrot-Buying-Guide.html"> <img src="images/button_3.gif" width="117" height="22" border="0" alt="African Grey Parrot buying Guide"></a></td> <td colspan="3"> <a href="/African-Grey-Parrot-Articles.html"> <img src="images/button_4.gif" width="117" height="22" border="0" alt="African Grey Parrot Articles"></a></td> <td colspan="3"> <a href="/forum"> <img src="images/button_5.gif" width="117" height="22" border="0" alt="African Grey Parrot Community"></a></td> </tr> <tr> <td rowspan="2"> <img src="images/icon_1.gif" width="24" height="25" border="0" alt=""></td> <td rowspan="2"> <img src="images/icon_2.gif" width="23" height="25" border="0" alt=""></td> <td colspan="2" rowspan="2"> <img src="images/icon_3.gif" width="23" height="25" border="0" alt=""></td> <td rowspan="2"> <img src="images/icon_4.gif" width="23" height="25" border="0" alt=""></td> <td rowspan="2"> <a href="/African-Grey-Parrot-Links.html"><img src="images/icon_5.gif" width="23" height="25" border="0" alt="African Grey Parrot Links"></a></td> <td rowspan="2"> <img src="images/icon_6.gif" width="23" height="25" border="0" alt=""></td> <td colspan="2" rowspan="2"> <img src="images/icon_7.gif" width="27" height="25" border="0" alt=""></td> <td colspan="9"> <img src="images/header_grey_bar.gif" width="584" height="17" alt=""></td> </tr> <tr> <td colspan="9"> <img src="images/header_spacer.gif" width="584" height="8" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="24" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="4" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="19" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="6" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="21" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="116" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="117" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="117" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="31" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="62" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="24" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="72" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="22" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> </tr> </table> <!-- HEADER TABLE; END --> </td> </tr> </table> <div align="center"> <table width="752" border="0" cellpadding="0" cellspacing="0" id="table7"> <tr> <td width="23"> <img src="images/main_icon.gif" width="23" height="21" alt=""></td> <td class="title" width="729" bgcolor="#E1DFDF"> <h1 class="title"><img src="images/spacer.gif" width="729 " height="1" alt=""><br> African Grey Parrot Breeders Directory </h1></td> </tr> </table> </div> <div align="center"> <table width="900" border="0" cellpadding="2" id="table1"> <tr> <td width="755" height="6" style="border:1px solid #C0C0C0; padding:4px; " align="center" bordercolor="#C0C0C0"> <p align="left"> Directory of African Grey Parrot Breeders. We only accept breeders who follow best practices. </td> </tr> <tr> <td height="6" style="border:1px solid #C0C0C0; padding:4px; " align="center" bordercolor="#C0C0C0"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><p>To find our more information about advertising here please <a href="/beederdetails.php">click here</a> </p> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <?php if ($totalRows_rstbreeder == 0) { // Show if recordset empty ?> <td>There are currently no breeders in the Directory, Be the first breeder to advertise here and get <span class="style2">25% off the normal price.</span> This is for one person only! </td> <?php } // Show if recordset empty ?> </tr> </table> <?php if ($totalRows_rstbreeder > 0) { // Show if recordset not empty ?> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr> <td width="200"><div align="left"><strong>Name and Address </strong></div></td> <td width="219"><div align="left"><strong>Contact Details </strong></div></td> <td width="300"><div align="left"><strong>Description</strong></div></td> <td width="64"><div align="left"><strong>Picture</strong></div></td> <td width="80"><div align="left"><strong>Visit Site </strong></div></td> </tr> <?php do { ?> <tr> <td width="200" valign="top"><p><?php echo $row_rstbreeder['company']; ?> <br> <?php echo $row_rstbreeder['firstname']; ?> <?php echo $row_rstbreeder['lastname']; ?> <br> <?php echo $row_rstbreeder['address1']; ?><br> <?php echo $row_rstbreeder['address2']; ?><br> <?php echo $row_rstbreeder['city']; ?> <br> <?php echo $row_rstbreeder['statecounty']; ?><br> <?php echo $row_rstbreeder['country']; ?></p> <p><br> </p></td> <td width="219" valign="top"><?php echo $row_rstbreeder['phone']; ?><br> <?php echo $row_rstbreeder['email']; ?> <br> </td> <td width="300" valign="top"><?php echo $row_rstbreeder['description']; ?></td> <td width="64" align="center" valign="top"> <?php echo '<img src="'; ?> <?php echo $row_rstbreeder['picture']; ?> <?php echo '" >'; ?> </td> <td width="80" align="center" valign="top"> <p> <?php echo '<a href="'; ?> <?php echo $row_rstbreeder['website']; ?> <?php echo '">'; ?> <?php echo $row_rstbreeder['website']; ?> <?php echo '</a>'; ?></p> <p> </p></td> </tr> <?php } while ($row_rstbreeder = mysql_fetch_assoc($rstbreeder)); ?> </table> <?php } // Show if recordset not empty ?> <p align="center"> </p> <p> </p> </td> </tr> <tr> <td>To find out more about advertising here please goto </td> </tr> </table></td> </tr> <tr> <td height="16" align="center" bordercolor="#C0C0C0" style="border:1px solid #C0C0C0; padding:4px; "> <p> <p align="center"> <a href="http://www.viparrot.com"> <img src="http://www.viparrot.com/skins/custom/styleImages/logo4.gif" width="463" height="88" border="0"></a></p> <p align="center">We highly recommend <a href="http://www.viparrot.com"> www.viparrot.com</a> for all your parrot supplies including <a href="http://www.viparrot.com/index.php?act=viewCat&catId=2"> parrot food</a>, <a href="http://www.viparrot.com/index.php?act=viewCat&catId=3"> parrot toys</a>, and <a href="http://www.viparrot.com/index.php?act=viewCat&catId=4"> parrot training accessories</a>.</td> </tr> <tr valign="top"> <td width="755" style="border: 1px solid #C0C0C0"> <p align="left"> <p align="left"> We add articles frequently so please keep popping back. In the mean time you could always join the buzzing <a href="forum">grey parrot forum</a>! <p align="center"> <a href="http://www.viparrot.com"> </a></td> </tr> </table> </div> <div align="center"> <table cellpadding="0" cellspacing="0" width="755" height="29" id="table2"> <!-- MSTableType="nolayout" --> <tr> <td valign="top" height="29" width="755"> <img border="0" src="images/footer.jpg" width="754" height="26"></td> </tr> </table> </div> <!-- PAGE TABLE; END --> </body> </html> <?php mysql_free_result($rstbreeder); ?> PHP:
See the table width below , sum up the column widths and assign width="columnwidth" instead of the 100% and align=center , that should fix it <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr> <td width="200"><div align="left"><strong>Name and Address </strong></div></td> <td width="219"><div align="left"><strong>Contact Details </strong></div></td> <td width="300"><div align="left"><strong>Description</strong></div></td> <td width="64"><div align="left"><strong>Picture</strong></div></td> <td width="80"> PHP: Good luck
Well, you should first do yourself a huge favor and axe about two thirds of that HTML on stupid stuff like tables around single elements, all that stupid wasted spacer.gif nonsense, div's to center tables that have perfectly good ID's on them, use various CSS properties like border-collapse and table-layout:fixed so you can axe all those cellspacing, cellpadding and border declarations... seriously: <div align="center"> <table cellpadding="0" cellspacing="0" width="755" height="29" id="table2"> <!-- MSTableType="nolayout" --> <tr> <td valign="top" height="29" width="755"> <img border="0" src="images/footer.jpg" width="754" height="26"></td> </tr> </table> </div> Code (markup): WTF? or even better: <td> <img src="images/spacer.gif" width="24" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="4" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="19" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="6" height="1" alt=""></td> <td> Code (markup): first off it's called rowspan, secondly even that shouldn't be needed since we have this thing called padding-bottom (or margin-bottom) or the icing on the cake: <tr> <td width="200"><div align="left"><strong>Name and Address </strong></div></td> <td width="219"><div align="left"><strong>Contact Details </strong></div></td> <td width="300"><div align="left"><strong>Description</strong></div></td> <td width="64"><div align="left"><strong>Picture</strong></div></td> <td width="80"><div align="left"><strong>Visit Site </strong></div></td> </tr> Code (markup): If you don't know what's wrong with that, do yourself a huge favor and take a year off to learn CSS. (or even some HTML, put the align on the td, change the td to th, lose the strong.) As I've said quite often of late about various websites, there is more of 1997 to this page than 2007. This is 13k of output for something that likely only needs about 3-5k of HTML and CSS given the total lack of actual page content.