开发者

how to place a space between to tables in php

How do I place a space between two tables which are vertical. The tables are within the php script:

 $result = mysql_query("SELECT * FROM t2 WHERE FIRSTNAME='{$_POST["fname"]}' AND HOSPNUM='{$_POST["hnum"]}'");
    echo "<table border='1'>
    <tr>
    <th>HospNum</th>
    <th>RoomNum</th>
    <th>LastName</th>
    <th>FirstName</th>
    <th>MidName</th>
    <th>AdmitDate</th>
    <th>AdmitTime</th>
    <th>Address</th>
    <th>TelNum</th>
    <th>Civil Status</th>
    </tr>";



    while($row = mysql_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>" . $row['HOSPNUM'] . "</td>";
      echo "<td>" . $row['ROOMNUM'] . "</td>";
        echo "<td>" . $row['LASTNAME'] . "</td>";
          echo "<td>" . $row['FIRSTNAME'] . "&开发者_JAVA技巧lt;/td>";
            echo "<td>" . $row['MIDNAME'] . "</td>";
             echo "<td>" . $row['ADDATE'] . "</td>";
              echo "<td>" . $row['ADTIME'] . "</td>";
              echo "<td>" . $row['ADDRESS'] . "</td>";
               echo "<td>" . $row['TELNUM'] . "</td>";
                echo "<td>" . $row['CSTAT'] . "</td>";


      echo "</tr>";
      }
    echo "</table>";



    $result2 = mysql_query("SELECT * FROM t2 WHERE FIRSTNAME='{$_POST["fname"]}' AND HOSPNUM='{$_POST["hnum"]}'");
    echo "<table border='1'>

    <th>Sex</th>
    <th>Age</th>
    <th>Birthday</th>
    <th>STAT1</th>
    <th>STAT2</th>
    <th>STAT4</th>
    <th>STAT5</th>
    <th>STAT6</th>
    <th>STAT7</th>
    <th>STAT8</th>

    </tr>";




    while($row = mysql_fetch_array($result2))
      {
      echo "<tr>";
      echo "<td>" . $row['SEX'] . "</td>";
      echo "<td>" . $row['AGE'] . "</td>";
        echo "<td>" . $row['BDAY'] . "</td>";
          echo "<td>" . $row['STAT'] . "</td>";
            echo "<td>" . $row['STAT2'] . "</td>";
             echo "<td>" . $row['STAT3'] . "</td>";
              echo "<td>" . $row['STAT4'] . "</td>";
              echo "<td>" . $row['STAT5'] . "</td>";
               echo "<td>" . $row['STAT6'] . "</td>";
                echo "<td>" . $row['STAT7'] . "</td>";
                echo "<td>" . $row['STAT8'] . "</td>";

      echo "</tr>";
      }
    echo "</table>";


use CSS to apply margin between the two tables:

<style type="text/css">
table{
  margin: 10px 0;
}
</style>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜