Jump to content


HUGE space between the top and first page content


  • Please log in to reply
4 replies to this topic

#1 Guest_D1proball_*

Guest_D1proball_*
  • Guests

Posted 28 March 2006 - 11:53 PM

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.

$result = mysql_query($query) or die("Error: " . mysql_error());



$i = 0;
$num = 3;

// Start the code for our table
echo "<center><table width=\"100%\" border=\"1\">";
echo "<tr>";

// Loop through our results
while ($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 cell
print"   <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 row
while ($i % $num) {
    echo "<td>&nbsp;</td>";
    $i++;
}

// Finish our tables code
echo "</tr>";
echo "</table>";

?>


#2 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 29 March 2006 - 12:23 AM

I think maybe this:
<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%">
may have something to do with it...

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 29 March 2006 - 12:40 AM

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.
follow me on twitter @PHPsycho

#4 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 29 March 2006 - 01:00 AM

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:

<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>


#5 Guest_D1proball_*

Guest_D1proball_*
  • Guests

Posted 29 March 2006 - 02:07 AM

[!--quoteo(post=359488:date=Mar 28 2006, 07:40 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 28 2006, 07:40 PM) View Post[/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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users