Table Highlighting

5 posts by 4 authors in: Forums > CMS Builder
Last Post: May 18, 2010   (RSS)

By (Deleted User) - May 17, 2010

I am setting up a table system but can not remember how to get the table to highlight every second line.

For example:

Date Time
24 2pm <-- white background
28 1pm <-- grey background
30 12pm <-- white background
31 5pm <-- grey background

Something like that.

Re: [hegadmin] Table Highlighting

By Jason - May 17, 2010

Hi,

Are you currently outputting a table without highlighting?
If you could post the code you have so far (or attach your .php file) I can help you do this.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Table Highlighting

By (Deleted User) - May 18, 2010 - edited: May 18, 2010

Yes I am using tables with out highlighting.

I have not created the page but I know how to do a listing of the section. I was not going to create the page until i figured out how to do the table highlighting.

Re: [hegadmin] Table Highlighting

By Kenny - May 18, 2010

You'll need to adapt to your fields, but try this:

<h3>Contact Us</h3>
<table>
<tr>
<th>title</th>
<th>name</th>
<th>phone</th>
<th>email</th>
</tr>
<?php foreach ($contact_listRecords as $record): ?>
<?php $bgColor = (@$bgColor == '#F8F8F8') ? '#EFEFEF' : '#F8F8F8'; ?>
<tr bgcolor="<?php echo $bgColor ?>">
<td><?php echo $record['title'] ?></td>
<td><?php echo $record['name'] ?></td>
<td><?php echo $record['phone'] ?></td>
<td><a href="mailto:<?php echo $record['email'] ?>"><?php echo $record['email'] ?></a></td>
</tr>
<?php endforeach; ?>
</table>



Kenny