PHP表和'标题'的位置是歪斜的

时间:2012-11-12 09:50:44

标签: php html

我正在编写的这个PHP代码大纲显示了3个表和表名的组合。当一次显示一个标题在表格上方时,但是当显示所有三个标题时,标签内的文本堆积在表格上方。知道如何解决这个问题吗?

<?php

if($_GET["pokemon"] == 'P')
     {
     #query to find pokemon cards in a deck
     <h2>Pokemon</h2>
     <table> #print a table based on query
     }

if($_GET["trainer"] == 'T')
     {
     #query to find trainer cards in a deck
     <h2>Trainers</h2>
     <table> #print a table based on query
     }

if($_GET["energies"] == 'E')
     {
     #query to find energy cards in a deck
     <h2>Energies</h2>
     <table> #print a table based on query
     }

?>

2 个答案:

答案 0 :(得分:2)

确保关闭<table></table>代码

您的其他标签也是如此:

<tr>
    <th></th>
</tr>
<tr>
    <td></td>
</tr>

答案 1 :(得分:1)

您需要关闭所有打开的标签..

imho,你打开三个表标签,可能只关闭一次..

另外,在帖子中添加更多代码..