• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change layout for specified rows

#5
[eluser]Beginers[/eluser]
You may try this method:
(correct me if i misunderstand your question)
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html xml:lang="en" lang="en"&gt;

&lt;head&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Alternating Color&lt;/title&gt;
    &lt;style type="text/css"&gt;
    .gray{
        background:#a3a3a3;
    }
    .green{
        background:#a8fe9f;
    }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
<table>
    <thead>
        <tr>
            <th>Alternate Color</th>
        </tr>
    </thead>
    <tbody>
        &lt;?php for($i=0;$i<=10;$i++):?&gt;
            <tr class="&lt;?php echo (($i%2)==0) ? "gray" : "green"?&gt;">
                <td>&lt;?php echo (($i%2)==0) ? "gray" : "green"?&gt;</td>
            </tr>
        &lt;?php endfor;?&gt;
    </tbody>
</table>
&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Change layout for specified rows - by El Forum - 10-04-2012, 05:19 AM
Change layout for specified rows - by El Forum - 10-04-2012, 05:33 AM
Change layout for specified rows - by El Forum - 10-04-2012, 05:57 AM
Change layout for specified rows - by El Forum - 10-04-2012, 05:23 PM
Change layout for specified rows - by El Forum - 10-04-2012, 07:15 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.