how to give the space between questions and answers in PHP.?
<tr><br><?php echo"1. your name:" . $row['name'];?></br></tr>"
<tr><br><?php echo"2. Age:" . $row['age'];?></br></tr>"
i need the output :
Your Name : Daz
Age : 20
Follow a proper table convention:
<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>
Please follow the perfect table structure so it will be easy for you i have setup an example please add the styling regarding you.
<table>
<tr>
<td>1. your name</td><td>:</td><td><?php echo $row['name'];?>/td>
</tr>
</table>
try this, use <td>
tag
<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>
You are opening a table row with <tr>
but not writing any table cells <td>
.
Try this:
<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>
I've taken the liberty of escaping the data from the database rows, never trust user input!