Welcome Guest, Not a member yet? Register   Sign In
960 Grid System
#2

[eluser]Colin Williams[/eluser]
In your loop, just check if you're on the first or last of your result set.

Code:
// $result is your array
for ($i = 0; $i < count($result); $i++)
{
   print '<div class="grid_2'
      . (($i == 0) ? ' alpha' : (($i + 1 == count($result)) ? ' omega' : NULL)
      . '">Other stuff</div>"; // Use $result[$i] to retrieve current item in loop
}

Double-check that though.. might be a bit buggy Smile You could do this in a foreach loop too if you preferred.

Also, I hate CSS "grid frameworks". They operate under a false assumption of what a gridded layout is. And, I think the HTML should be made to best describe the content it marks up, not formed to play well with CSS rules in place.


Messages In This Thread
960 Grid System - by El Forum - 07-04-2008, 02:49 AM
960 Grid System - by El Forum - 07-04-2008, 03:47 AM
960 Grid System - by El Forum - 07-12-2008, 12:23 PM
960 Grid System - by El Forum - 07-12-2008, 03:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB