Skip to content
Advertisement

How to use if elseif inside table row without making a new row?

I want to make a code that can use if else if inside table row.

But I can’t make it ,once I use else if statement inside table row it make a new row by it self.

I expect that it make a new column in the same row

Here’s a code

JavaScript

as you can see what I expected is else if statement show the output in a same row but , here’s the result

enter image description here

Advertisement

Answer

You do new row (<tr>) every time when loop (next line after foreach).

But what you want to do is to have it only when condition (<?php if ($k['nama_petugas'] != $varpetugas) : ?>) is true.

Try this:

JavaScript

PS: Why do you have elseif? You can simply do just else. Isn’t it?

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement