Hi all,
I’m using EE’s Grid Field and looping the content within a table. I’ve divided the grid fields into two table rows on my site. I need to have each grid entry have the same background, then alternate for every entry. I’ve only been able to get {switch} to alternate the background for every other row, but not for every two rows (which is listed in the code below).
I’ve seen examples in the forum where people have used multiple pipe characters to achieve different results, so maybe that’s the solution… but I really don’t know and I can’t find any explanation of that in the user guide. I would appreciate any suggestions.
Here’s my code:
<table>
{profiles}
<!-- *********** top row *********** -->
<tr class="{switch='odd|even'}">
<td>{profiles:first_name}</td>
<td>{profiles:last_name}</td>
<td>{profiles:height}</td>
<td>{profiles:position}</td>
<td>{profiles:class}</td>
<td>{profiles:level}</td>
<td>{profiles:hometown}</td>
<td>{profiles:state}</td>
<td>{profiles:school}</td>
<td>{profiles:phone}</td>
<td><a href="mailto:{profiles:email}">{profiles:email}</a></td>
</tr>
<!-- *********** bottom row *********** -->
<tr>
<td colspan="11">{profiles:comments}</td>
</tr>
{/profiles}
</table>Many thanks,
John
ExpressionEngine v2.7.2