CSS problem on Product Listing

6 posts by 2 authors in: Forums > CMS Builder
Last Post: March 28, 2008   (RSS)

By jposwald - March 27, 2008

Hello, please i need help to figure out this, im not a expert programmer so, i need your advise.

I have to list elearning courses, but i have next problem:

When i give a cell a class, i do not know why the 2nd course listing do not respect it.

I'm sure you will have this easy solution;

Link is: http://www.worldwidetrainings.net/products_elearningList.php

Please see page's source code to see how i did it.

Thank you

Re: [jposwald] CSS problem on Product Listing

By Dave - March 28, 2008

Are you referring to the class "texto-curso_titulo". When I view source I see it's not in the <td> for the second record. Can you attach the viewer file (products_elearningList.php) so I can see the source?

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CSS problem on Product Listing

By jposwald - March 28, 2008

For sure, I attached the file you required.

Thank you for your help :)

Re: [jposwald] CSS problem on Product Listing

By Dave - March 28, 2008

Ok thanks,

Typically you want to have your starting and ending foreach tags outside of a <td> or <tr> so they create a row for each record. I think what you may want is this:

<?php foreach ($listRows as $record): ?>
<tr>
<td width="378" height="25" valign="top" class="texto-curso_titulo"> <?php echo $record['name'] ?> </td>
<td width="50" valign="top" class="texto-curso_id">ID:</td>
<td width="100" valign="top" class="texto-curso_id"><?php echo $record['product_id_sku'] ?>
</td>
</tr>
<tr>
<td height="25" valign="top" class="texto-curso_fecha"><?php echo date("D, M jS, Y g:i:s a", strtotime($record['date'])) ?>
<!-- For date formatting codes see: http://www.php.net/date -->
</td>
<td valign="top" class="texto-curso_precio">Precio:</td>
<td valign="top" class="texto-curso_precio"><?php echo $record['price'] ?>
</td>
</tr>
<tr>
<td height="28" colspan="3" valign="top" class="texto-curso_intro"><?php echo $record['summary'] ?></td>
</tr>
<tr>
<td height="25" colspan="3" valign="top" class="texto-curso_link"><a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a></td>
</tr>
<tr>
<td height="20" colspan="3" valign="top"> <hr align="center" size="2" noshade="noshade"/></td>
</tr>
<?php endforeach ?>


Also, try turning on the border for your table, I think it will help with debugging. Give that a try and let me know if you get any closer.
Dave Edis - Senior Developer
interactivetools.com

Re: [jposwald] CSS problem on Product Listing

By Dave - March 28, 2008

No problem, just use utf-8 as character encoding. Everything else should still display fine as well. Change this at the top of your page:

<?xml version="1.0" encoding="UTF-8"?><html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com