Jump to content

[SOLVED] table breaks


richiec

Recommended Posts

Hey first of it started as a php question, but once that was solved it then became a html problem so i thought it best to close that thread on php help and make a new one here for the new problem.

 

the table code bellow worked fine untill i added an if/else code into it.. since i added that the table now breaks after the first item.

 

you will see what i mean here http://fearedwarlords.dks-gfx.com/items/items.php

 

the code is:

 

if ($_REQUEST["gem"] != NULL){

$i++;

echo "
<tbody><tr>
<td colspan=\"2\" style=\"font-weight: bold; height: 20px; font-size: 10pt; color: rgb(204, 204, 204);\" align=\"left\">$name x $stock</td>
</tr>
<tr>
<td style=\"padding: 2px; font-family: Verdana; font-weight: bold; font-size: 7pt; color: rgb(255, 255, 255);\" align=\"left\" valign=\"top\">
<br>
$hitpoints2 Hit points<br>$attack2 Attack<br>$rage2 Rage per turn<br>$maxrage2 Max Rage<br>$exp2 Experience per turn <br>$rampage2 % Rampage<br>$critical % Critical hit<br>$block % Block <br><br>
</td>

<td style=\"width: 80px; font-family: Verdana; font-size: 7pt; color: rgb(255, 255, 255);\" align=\"center\" valign=\"top\">
<img src=\"$image\" style=\"border: 1px solid rgb(102, 102, 102); margin: 2px;\"></a><br>
<img src=\"http://fearedwarlords.dks-gfx.com/images/gem_green.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gem_blue.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gem_red.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gem_white.jpg\"><br>
<img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><br></td>			
</tr>


</tbody></table></td></tr></tbody></table></center></div>";

} else {

$i++;

echo "
<tbody><tr>
<td colspan=\"2\" style=\"font-weight: bold; height: 20px; font-size: 10pt; color: rgb(204, 204, 204);\" align=\"left\">$name x $stock</td>
</tr>
<tr>
<td style=\"padding: 2px; font-family: Verdana; font-weight: bold; font-size: 7pt; color: rgb(255, 255, 255);\" align=\"left\" valign=\"top\">
<br>
$hitpoints Hit points<br>$attack Attack<br>$rage Rage per turn<br>$maxrage Max Rage<br>$exp Experience per turn <br>$rampage % Rampage<br>$critical % Critical hit<br>$block % Block <br><br>
</td>

<td style=\"width: 80px; font-family: Verdana; font-size: 7pt; color: rgb(255, 255, 255);\" align=\"center\" valign=\"top\">
<img src=\"$image\" style=\"border: 1px solid rgb(102, 102, 102); margin: 2px;\"></a><br>
<img src=\"http://fearedwarlords.dks-gfx.com/images/gemslot.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gemslot.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gemslot.jpg\"> <img src=\"http://fearedwarlords.dks-gfx.com/images/gemslot.jpg\"><br>
<img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><img src=\"http://fearedwarlords.dks-gfx.com/images/augslot.jpg\"><br></td>			
</tr>


</tbody></table></td></tr></tbody></table></center></div>";

 

Any ideas why it breaks the table after the first item?

Link to comment
Share on other sites

It's a starightforward html problem.  If you add a border to each table and change the page background so you can see the border, you'll soon spot the mismatched table tags that are causing the problem.

Link to comment
Share on other sites

Thats just it though, it all echos from mysql db and before i added the if/else command for the gems the table worked fine it only pulls the table info once from the php code which i pasted and it puts each one into a new line.. i know it works because it displays the first item corectly its just suposed to display the others under it insted of outside the table..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.