Welcome Guest, Not a member yet? Register   Sign In
Arrays, tables and headache
#2

[eluser]Michael Wales[/eluser]
Don't use the tables helper - go straight HTML with it.

Psuedo-code, not your vars:
Code:
<? foreach($albums as $album): ?>
  <h3>&lt;?= $album->name; ?&gt;</h3>
  <table>
    <tr>
    &lt;? $count = 0; ?&gt;
    &lt;? foreach ($album->picture as $picture): ?&gt;
      &lt;? $count++; ?&gt;
      <td><img src="&lt;?= $picture->url; ?&gt;" /></td>
      &lt;? if (($count % 4) == 0): ?&gt;
        </tr><tr>
      &lt;? endif; ?&gt;
    &lt;? endforeach; ?&gt;
    </tr>
  </table>

&lt;? endforeach; ?&gt;


Messages In This Thread
Arrays, tables and headache - by El Forum - 02-24-2008, 03:14 PM
Arrays, tables and headache - by El Forum - 02-24-2008, 03:38 PM
Arrays, tables and headache - by El Forum - 02-24-2008, 03:57 PM
Arrays, tables and headache - by El Forum - 02-24-2008, 04:28 PM
Arrays, tables and headache - by El Forum - 02-24-2008, 05:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB