mercredi 26 juillet 2017

Include if statement in html table

I want to include an if-statement in my html table. The output should be in a table row too.

echo '<table style="border:1px solid red;">',
 '<tr align="center" ><td><div class="item-font1">', $mounts['name'], '</div></td>
</tr>',
 if ($itembind == 1) {
echo '<tr align="center" ><td><div class="item-font1">Text1</div></td>
</tr>',
} elseif ($itembind== 2) {
echo '<tr align="center" ><td><div class="item-font1">Text2</div></td>
</tr>',
echo "\t";
}
 '<tr align="center" ><td><div class="item-font1">', $mounts['name'], '</div></td>
</tr>  
</table>';
?>

I tried it like this, but there are some errors.

Aucun commentaire:

Enregistrer un commentaire