I wan't to alternate colors to rows in the index view but when i call
css it is not calling
my code is as follows:
code of index view


<h2>Welcome <?php echo $id=$session->read('User')?></h2>
 <div class="entries">
 <?php
echo $html->css('default');
?>
<table cellpadding="0" cellspacing="0">
<?echo $html->tableHeaders(
    array(

      'Section',
      'Submenu',
      'Listitem',
          'Detail',
          'Actions'
    )
);?>
<?php
$i = 0;
 foreach ($entries as $entry):
   $class = null;
        if ($i++ % 2 == 0) {
             $class ='class="altrow"';
        }
  ?>
<tr<?php echo $class;?>>
        <td><?php echo $entry['Section']['section']; ?></td>
        <td><?php echo $entry['Submenu']['submenu']; ?></td>
        <td><?php echo $entry['Entry']['Listitem']; ?></td>
        <td><?php echo $entry['Entry']['Detail']; ?></td>
        <td class="actions">
                <?php echo $html->link('View','/entries/view/' . $entry['Entry']
['id'])?>
                <?php echo $html->link('Edit','/entries/edit/' . $entry['Entry']
['id'])?>
                <?php echo $html->link('Delete','/entries/delete/' . 
$entry['Entry']
['id'], null, 'Are you sure you want to delete record' )?>
        </td>
</tr>
<?php endforeach; ?>
</table>
<ul class="actions">
<li><?php echo $html->link('New Content entry', '/entries/add'); ?></
li>
<li><?php echo $html->link('Logout','/users/logout');?></li>
<li><?php echo $html->link('Manage Account','/users/edit'.$form->value
('User'.$id));?></li>
</ul>
</div>

my css is follows
table {
        background: #fff;
        border:1px solid #ccc;
        border-right:0;
        clear: both;
        color: #333;
        margin-bottom: 10px;
        width: 100%;
}
th
{
  background: #f2f2f2;
        border:1px solid #bbb;
        border-top: 1px solid #fff;
        border-left: 1px solid #fff;
        text-align: center;
}

.altrow
{
  background-color: #D4FFA8;
  border-top: 1px solid #000000;
  border-bottom: 1px solid #000000;
}

can anybody tell me what is the problem

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to