弄乱了HTML / CSS设计

时间:2013-02-13 23:40:00

标签: php html css

enter image description here

我只是在检查其他人的作品,我正在修理这个设计,我似乎无法知道如何修复它。我不想改变css中的任何内容,所以可以在html上安排它吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Clinical Module</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="inc/style.css" type="text/css">

</head>
<body>
<form action='' method='POST'><center>
<input type="text" placeholder="Patient Number" name="search" > <input type="submit" Value="Check" name='submit'> <br>


<?php

mysql_connect("localhost","root","");
mysql_select_db("invoices");
$search = 0;
$search=$_POST['search'];
if (isset($_POST['submit'])){

    $query = "select * from `patient` where `clientid` = $search ";
    $result=mysql_query($query);


while($row = mysql_fetch_array($result)){ ?>

First name:<br>
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" size="20" name="first_name" value="<?php echo $row["first_name"]?>" ></td>
      <td valign="top" width="10%" rowspan="13">
      </td>
   </tr>
   <tr>

      <td valign="top" align="right">
      Middle name:</td>
       <td valign="top" align="left">
&nbsp;<input type="text" size="20" name="middle_name" value="<?php echo $row["middle_name"]?>" ></td>

      </td>
   </tr>
    <tr>
      <td valign="top" align="right">
Last Name:
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" name="last_name" size="20" value="<?php echo $row["last_name"]?>"></td>
   </tr>
 <tr>
      <td valign="top" align="right">
Birthdate
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" name="Birthdate" size="20" value="<?php echo $row["birthdate"]; ?>"></td>
   </tr>
 <tr>
      <td valign="top" align="right">
Age
</td>
      <td valign="top" align="left">
&nbsp;<input  readonly type="text" name="age" size="20" value="<?php echo $row["age"]?>" placeholder="YYYY-MM-DD"></td>
   </tr>

   <tr> 
    <td valign="top" align="right"> Gender:</td>

      <td valign="top" align="left"><select name="gender">
      <? if ($row["gender"]==Male) { ?>
      <option value="Male" selected>Male</option>
      <option value="Female">Female</option> 
      <? }else if ($row["gender"]==Female) { ?>
      <option value="Male" >Male</option>
      <option value="Female" selected>Female</option>  <?php }?>      
    </select></tr>
        </td><tr> 
    <td valign="top" align="right"> Civil Status:</td>
      <td valign="top" align="left"><select name="civil_status">
      <? if ($row["civil_status"]==Single) { ?>
      <option value="Single" selected >Single</option>
      <option value="Married">Married</option> 
      <option value="Separatede">Separated</option>
      <option value="Widowed">Windowed</option>
      <? }else if ($row["civil_status"]==Married) { ?>
      <option value="Single" >Single</option>
      <option value="Married" selected>Married</option> 
      <option value="Separated">Separated</option>
      <option value="Widowed">Windowed</option>
     <? }else if ($row["civil_status"]==Separated) { ?>
      <option value="Single" >Single</option>
      <option value="Married">Married</option> 
      <option value="Separated" selected>Separated</option>
      <option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Widowed) { ?>
      <option value="Single" >Single</option>
      <option value="Married">Married</option> 
      <option value="Separated">Separated</option>
      <option value="Widowed" selected>Windowed</option>      <?php }?>
     </select> 
         </td>
    </tr>    
 <tr>
      <td valign="top" align="right" nowrap>
Address:</td>
      <td valign="top" align="left">
<input type="text" name="address" value="<?php echo $row["address"]?>" size="31"></td>
      </tr>   

        <tr>
      <td valign="top" align="right">
Tel. no.:</td>
      <td valign="top" align="left">
<input
 type="text" size="20" name="telno" placeholder="###-####" value="<?php echo $row["telno"]?>"></td></tr>
 <tr>
      <td valign="top" align="right">
Occupation:</td>
      <td valign="top" align="left">
<input
 type="text" size="20" name="occ" value="<?php echo $row["occ"]?>"></td></tr>
 <tr>
      <td align="right">
Spouse:</td>
      <td >
<input
 type="text" size="20" name="spo" value="<?php echo $row["spo"]?>"></td></tr><tr>
  <td align="right">
Occupation:</td>
      <td >
<input
 type="text" size="20" name="occ2" value="<?php echo $row["occ2"]?>"></td></tr>



 <tr>
      <td align="right" width="20">
Contact Person(in case of emergency):</td>
      <td >
<input
 type="text" size="20" name="cp" value="<?php echo $row["cp"]?>"></td></tr><tr>
  <td align="right">
Tel. no:</td>
      <td >
<input
 type="text" size="20" name="tel2" value="<?php echo $row["tel2"]?>"></td></tr>



      <tr>
      <td valign="top" align="right" nowrap>
Reffered By:</td>
      <td valign="top" align="left">
<input type="text" name="reff" value="<?php echo $row["reff"]?>" size="31" ></td>
      </tr>

          <tr>
      <td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Past Medical History:</td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Allergy:</td>
      <td valign="top" align="left">
<input type="text" name="all" value="<?php echo $row["all"]?>" size="31"></td>
      </tr> 
      <tr>
      <td valign="top" align="right" nowrap>
Previous illness:</td>
      <td valign="top" align="left">
<input type="text" name="ill" value="<?php echo $row["ill"]?>" size="31"></td>
      </tr>

    <tr>
     <td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Maternal:
     </td>
      <td valign="top" align="left">
<input type="text" name="mat" value="<?php echo $row["mat"]?>" size="20"></td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Fraternal:
     </td>
      <td valign="top" align="left">
<input type="text" name="frat" value="<?php echo $row["frat"]?>" size="20"></td>
      </tr>


<?  }
}
?>


</center>
</form>
|

1 个答案:

答案 0 :(得分:3)

我不确定这是否就是你所指的,因为你没有指明大量的信息......

然而,

  • 此表单上似乎没有实际的<table></table>标记...
  • 不,打开<tr>标签(正如Tim Medora在下面指出的......谢谢!)......
  • <td valign="top" align="right">
  • 之前也没有开始First name:<br>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Clinical Module</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="inc/style.css" type="text/css">

</head>
<body>
<form action='' method='POST'><center>
<input type="text" placeholder="Patient Number" name="search" > <input type="submit" Value="Check" name='submit'> <br>

<table>
<?php

mysql_connect("localhost","root","");
mysql_select_db("invoices");
$search = 0;
$search=$_POST['search'];
if (isset($_POST['submit'])){

    $query = "select * from `patient` where `clientid` = $search ";
    $result=mysql_query($query);

while($row = mysql_fetch_array($result)){ ?>

<tr>
<td valign="top" align="right">
First name:<br>
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" size="20" name="first_name" value="<?php echo $row["first_name"]?>" ></td>
      <td valign="top" width="10%" rowspan="13">
      </td>
   </tr>
   <tr>

      <td valign="top" align="right">
      Middle name:</td>
       <td valign="top" align="left">
&nbsp;<input type="text" size="20" name="middle_name" value="<?php echo $row["middle_name"]?>" ></td>

      </td>
   </tr>
    <tr>
      <td valign="top" align="right">
Last Name:
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" name="last_name" size="20" value="<?php echo $row["last_name"]?>"></td>
   </tr>
 <tr>
      <td valign="top" align="right">
Birthdate
</td>
      <td valign="top" align="left">
&nbsp;<input type="text" name="Birthdate" size="20" value="<?php echo $row["birthdate"]; ?>"></td>
   </tr>
 <tr>
      <td valign="top" align="right">
Age
</td>
      <td valign="top" align="left">
&nbsp;<input  readonly type="text" name="age" size="20" value="<?php echo $row["age"]?>" placeholder="YYYY-MM-DD"></td>
   </tr>

   <tr> 
    <td valign="top" align="right"> Gender:</td>

      <td valign="top" align="left"><select name="gender">
      <? if ($row["gender"]==Male) { ?>
      <option value="Male" selected>Male</option>
      <option value="Female">Female</option> 
      <? }else if ($row["gender"]==Female) { ?>
      <option value="Male" >Male</option>
      <option value="Female" selected>Female</option>  <?php }?>      
    </select></tr>
        </td><tr> 
    <td valign="top" align="right"> Civil Status:</td>
      <td valign="top" align="left"><select name="civil_status">
      <? if ($row["civil_status"]==Single) { ?>
      <option value="Single" selected >Single</option>
      <option value="Married">Married</option> 
      <option value="Separatede">Separated</option>
      <option value="Widowed">Windowed</option>
      <? }else if ($row["civil_status"]==Married) { ?>
      <option value="Single" >Single</option>
      <option value="Married" selected>Married</option> 
      <option value="Separated">Separated</option>
      <option value="Widowed">Windowed</option>
     <? }else if ($row["civil_status"]==Separated) { ?>
      <option value="Single" >Single</option>
      <option value="Married">Married</option> 
      <option value="Separated" selected>Separated</option>
      <option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Widowed) { ?>
      <option value="Single" >Single</option>
      <option value="Married">Married</option> 
      <option value="Separated">Separated</option>
      <option value="Widowed" selected>Windowed</option>      <?php }?>
     </select> 
         </td>
    </tr>    
 <tr>
      <td valign="top" align="right" nowrap>
Address:</td>
      <td valign="top" align="left">
<input type="text" name="address" value="<?php echo $row["address"]?>" size="31"></td>
      </tr>   

        <tr>
      <td valign="top" align="right">
Tel. no.:</td>
      <td valign="top" align="left">
<input
 type="text" size="20" name="telno" placeholder="###-####" value="<?php echo $row["telno"]?>"></td></tr>
 <tr>
      <td valign="top" align="right">
Occupation:</td>
      <td valign="top" align="left">
<input
 type="text" size="20" name="occ" value="<?php echo $row["occ"]?>"></td></tr>
 <tr>
      <td align="right">
Spouse:</td>
      <td >
<input
 type="text" size="20" name="spo" value="<?php echo $row["spo"]?>"></td></tr><tr>
  <td align="right">
Occupation:</td>
      <td >
<input
 type="text" size="20" name="occ2" value="<?php echo $row["occ2"]?>"></td></tr>

 <tr>
      <td align="right" width="20">
Contact Person(in case of emergency):</td>
      <td >
<input
 type="text" size="20" name="cp" value="<?php echo $row["cp"]?>"></td></tr><tr>
  <td align="right">
Tel. no:</td>
      <td >
<input
 type="text" size="20" name="tel2" value="<?php echo $row["tel2"]?>"></td></tr>

     <tr>
      <td valign="top" align="right" nowrap>
Reffered By:</td>
      <td valign="top" align="left">
<input type="text" name="reff" value="<?php echo $row["reff"]?>" size="31" ></td>
      </tr>

          <tr>
      <td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Past Medical History:</td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Allergy:</td>
      <td valign="top" align="left">
<input type="text" name="all" value="<?php echo $row["all"]?>" size="31"></td>
      </tr> 
      <tr>
      <td valign="top" align="right" nowrap>
Previous illness:</td>
      <td valign="top" align="left">
<input type="text" name="ill" value="<?php echo $row["ill"]?>" size="31"></td>
      </tr>

    <tr>
     <td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Maternal:
     </td>
      <td valign="top" align="left">
<input type="text" name="mat" value="<?php echo $row["mat"]?>" size="20"></td>
      </tr>
    <tr>
      <td valign="top" align="right" nowrap>
Fraternal:
     </td>
      <td valign="top" align="left">
<input type="text" name="frat" value="<?php echo $row["frat"]?>" size="20"></td>
      </tr>


<?  }
}
?>

</table>
</center>
</form>