Welcome Guest, Not a member yet? Register   Sign In
Alternate row colours
#5

[eluser]alphane[/eluser]
What's wrong with just giving the alternative div a new css class when printing each property?

Code:
$alt = 'alt';
*start loop*
    <?
    if ($alt) {
        $alt = '';
    }
    else
    {
        $alt = 'alt';
    }
    ?>
    <div class="property &lt;?=$alt;?&gt;">
        //content...
    </div>

*do loop*

So you're looking for an output of
Code:
<div class="property"></div>
<div class="property alt"></div>
<div class="property"></div>
<div class="property alt"></div>
<div class="property"></div>


Messages In This Thread
Alternate row colours - by El Forum - 01-07-2010, 07:53 AM
Alternate row colours - by El Forum - 01-07-2010, 07:55 AM
Alternate row colours - by El Forum - 01-07-2010, 07:59 AM
Alternate row colours - by El Forum - 01-07-2010, 08:06 AM
Alternate row colours - by El Forum - 01-07-2010, 08:12 AM
Alternate row colours - by El Forum - 01-07-2010, 08:13 AM
Alternate row colours - by El Forum - 01-07-2010, 08:14 AM
Alternate row colours - by El Forum - 01-07-2010, 08:35 AM
Alternate row colours - by El Forum - 01-08-2010, 04:02 AM
Alternate row colours - by El Forum - 01-08-2010, 07:51 AM
Alternate row colours - by El Forum - 01-08-2010, 08:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB