foreach 로 데이터 뽑아내는 과정중에


<foreach >

<if test 

<th1 ~~~~~~~~

<if test

<th2 ~~~~~~~~

<if test

<th3 ~~~~~~~


</foreach>


이렇게 짜면 foreach 인덱스에 따라서 순서대로 if 문 걸리는 애들이 th 가 출력이 되니깐 th1 th2 th3 이 짬뽕으로 나오겠지?

내가 지금 하는건 기존 데이터가 있어서 th1 th2 th3 이 순서대로 뽑아야함


그래서 내가 한건

<foreach>

<if test

<th1 ~

</foreach>


<foreach>

<if test

<th2 ~

</foreach>


<foreach>

<if test

<th3 ~

</foreach>


이렇게 해서 순서대로 뽑아놓긴했는데.. 더 좋은 방법 있을까? 내가 봐도 ㅋㅋ 개 좆같이 코드짠거같아서..