私が書いているこのphpコードの概要は、3つのテーブルとテーブル名の組み合わせを示しています。1 つずつ表示するとタイトルが表の上に表示されますが、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
}
?>