如何在PHP中给出问题和答案之间的空间


how to give the space between questions and answers in PHP.?

如何在PHP中给出问题和答案之间的空间。

<tr><br><?php echo"1. your name:" . $row['name'];?></br></tr>"
<tr><br><?php echo"2. Age:" . $row['age'];?></br></tr>"

我需要输出:

 Your Name        : Daz 
 Age              : 20 

遵循适当的表约定:

<table>
   <tr>
     <th><?php echo "Your name:"; ?></th> 
     <td><?php echo $row['name'];?></td>
   </tr>
   <tr>
     <th><?php echo "Age:"; ?></th> 
     <td><?php echo $row['age'];?></td>
  </tr>
</table>

请遵循完美的表结构,这样对你来说就很容易了。我已经设置了一个例子,请为你添加样式。

<table>
    <tr>
        <td>1. your name</td><td>:</td><td><?php echo $row['name'];?>/td>
    </tr>
</table>

试试这个,使用<td>标签

    <tr>
     <th><?php echo "Your name"; ?></th> 
     <td><?php echo ":"; ?></td> 
     <td><?php echo $row['name'];?></td>
   </tr>
   <tr>
     <th><?php echo "Age"; ?></th> 
     <td><?php echo ":"; ?></td>  
     <td><?php echo $row['age'];?></td>
  </tr>

打开<tr>的表行,但不写入任何<td>的表单元格。

试试这个:

<tr><td>1. your name:</td><td><?php echo htmlentities($row['name'], 'utf-8', ENT_QUOTES); ?></td></tr>
<tr><td>2. Age:</td><td><?php echo htmlentities($row['age'], 'utf-8', ENT_QUOTES); ?></td></tr>

我已经从数据库行中转义了数据,从不相信用户输入!