I have a table that has the columns ID, A, A_potential, B, B_potential, ...
Some columns have value, some do not. If A doesn't have value, A_potential doesn't either. I want to only display the columns that have value but also pair the columns with each other. Then loop it so it displays them paired together if they have value.
WHAT I WANT TO SHOW
<div class="item">
<div class="current">30</div> <!--A Value-->
<div class="potential">35</div> <!--A Potential-->
</div>
<div class="item">
<div class="current">50</div> <!--C Value-->
<div class="potential">75</div> <!--C Potential-->
</div>
CURRENT TABLE
ID | A | A_potential | B | B_potential
--------------------------------------
1 | 35 | 50 | 15 | 30
2 | 0 | 0 | 10 | 70
WHAT I WANT TABLE TO LOOK LIKE FOR LOOP PURPOSES
ID | Type | Current | Potential
--------------------------
3 | A | 35 | 50
3 | D | 50 | 75