richiec Posted July 30, 2007 Share Posted July 30, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/62550-solved-table-breaks/ Share on other sites More sharing options...
AndyB Posted July 30, 2007 Share Posted July 30, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/62550-solved-table-breaks/#findComment-311347 Share on other sites More sharing options...
richiec Posted July 30, 2007 Author Share Posted July 30, 2007 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.. Quote Link to comment https://forums.phpfreaks.com/topic/62550-solved-table-breaks/#findComment-311354 Share on other sites More sharing options...
richiec Posted July 30, 2007 Author Share Posted July 30, 2007 fixed it, thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/62550-solved-table-breaks/#findComment-311374 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.