Hi,
I have 15 entries that I need to output in an HTML table. The table needs to have 5 row and 3 columns.
Each entry has a position where it needs to be placed within the table (see attached).
When adding the entries I’ve given each one a column (A, B or C) and shelf position (0 Base, 1, 2, 3 or 4).
I’m struggling to output the correct HTML.
Could someone please help.
Thanks
Wayne.
I’ve managed to output the table in the correct format.
What I need now is it to put the entries in the correct order.
The image attached show the table with the entries in black. The number in brackets is the count. The red text is the order that I need to achieve.
Any help would be appreciated.
Thanks
Wayne
I frequently use channels to output tables. I set the data up a little differently. Each channel entry becomes a row. I can choose the order by using the orderby=” ” parameter. If I need a custom order that isn’t native to ee, then I add a numeric field to the channel and input the order. You can then sort ascending (asc) or descending (desc). The “field-to-sort-by” in my example, below, does not have to appear in the table, it just tells ee what order to loop through the channel entries.
<table>
<tr>
<th>Column 1 Header</th>
<th>Column 2 Header</th>
</tr>
{exp:channel:entries channel="mychannel" orderby="{field-to-sort-by}" sort="asc"}
<tr>
<td>{field-for-column-1}</td>
<td>{field-for-column-2}</td>
</tr>
{/exp:channel:entries}
</table>I think you might still be able to add a numeric field to the channel to control the sorting order with the way you are populating the table.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.