Guest D1proball Posted March 28, 2006 Share Posted March 28, 2006 Okay so for some reason this huge blank space is appearing before my content appears. You can check it out here. [a href=\"http://www.acadvocates.com/itemsearch3.php\" target=\"_blank\"]http://www.acadvocates.com/itemsearch3.php[/a]Here's the code...I left out the connection part on purpose.[code]$result = mysql_query($query) or die("Error: " . mysql_error());$i = 0;$num = 3;// Start the code for our tableecho "<center><table width=\"100%\" border=\"1\">";echo "<tr>";// Loop through our resultswhile ($row = mysql_fetch_assoc($result)) { // If our count is at zero, this is the first row if ($i==0) {echo "<table border=\"1\" width=\"95%\"><tr>";} // If our count is higher than zero, and the modulus of our count // and our number of columns is equal to zero, we have reached // our last column, so close the previous and open a new one if (($i > 0) && ($i % $num == 0)) {echo "</tr><tr><br>";} // If we are in the middle of a coumn, insert a cellprint" <td><table width=\"100%\" height=\"100%\" border=\"1\"> <tr> <td width=\"7%\" rowspan=\"3\"><img src=\"/images/accessories/$row[mage]\" width=\"95\" height=\"85\"></td> <td width=\"93%\" height=\"29\">$row[name]</td> </tr> <tr> <td height=\"31\">$row[price]</td> </tr> <tr> <td>$row[origin]</td> </tr> </table></td>"; // Increment our count $i++;}// Fill in any empty cells on our last rowwhile ($i % $num) { echo "<td> </td>"; $i++;}// Finish our tables codeecho "</tr>";echo "</table>";?>[/code] Quote Link to comment Share on other sites More sharing options...
khendar Posted March 29, 2006 Share Posted March 29, 2006 I think maybe this:[code]<center><table border="1" width="100%"><tbody><tr></tr></tbody></table><br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <table border="1" width="95%"><tbody><tr> <td><table border="1" height="100%" width="100%">[/code]may have something to do with it... Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted March 29, 2006 Share Posted March 29, 2006 I think you should have a long hard look at your html!!!!There is not even a start and end html tag!!!!!Once you have something near a valid html file then worry why it doesn't look exactly how u want. Quote Link to comment Share on other sites More sharing options...
khendar Posted March 29, 2006 Share Posted March 29, 2006 I think you have a bit oF redundant code here. You dont really need the outer enclosing <table> tags. I removed them - go the same effect and no white space:[code]<center> <table border="1" width="95%"> <tr> <td> <table width="100%" height="100%" border="1"> <tr> <td width="7%" rowspan="3"><img src="/images/accessories/" width="95" height="85"></td> <td width="93%" height="29">White Cap</td> </tr> <tr> <td height="31">160</td> </tr> <tr> <td>Able Sisters</td> </tr> </table> </td> <td> <table width="100%" height="100%" border="1"> <tr> <td width="7%" rowspan="3"><img src="/images/accessories/" width="95" height="85"></td> <td width="93%" height="29">Red Cap</td> </tr> <tr> <td height="31">160</td> </tr> <tr> <td>Able Sisters</td> </tr> </table> </td> <td> <table width="100%" height="100%" border="1"> <tr> <td width="7%" rowspan="3"><img src="/images/accessories/" width="95" height="85"></td> <td width="93%" height="29">Yellow Cap</td> </tr> <tr> <td height="31">160</td> </tr> <tr> <td>Able Sisters</td> </tr> </table> </td> </table><center>[/code] Quote Link to comment Share on other sites More sharing options...
Guest D1proball Posted March 29, 2006 Share Posted March 29, 2006 [!--quoteo(post=359488:date=Mar 28 2006, 07:40 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 28 2006, 07:40 PM) [snapback]359488[/snapback][/div][div class=\'quotemain\'][!--quotec--]I think you should have a long hard look at your html!!!!There is not even a start and end html tag!!!!!Once you have something near a valid html file then worry why it doesn't look exactly how u want.[/quote]Hey bud thanks for the nice comment there, but yeah I use php includes to include my templates which have the <html> <head> etc.. and i tried it earlier with those included and it didnt work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.