 |

_kate_
User

Jun 8, 2008, 5:26 AM
Post #1 of 3
(291 views)
Shortcut
|
|
Displaying list view in columns
|
Can't Post
|
|
I am trying to get the data from the List view page to display in a table in 2 columns - I tried some of the codes in some of the other threads however I couldn't get these to work. Any help is appreciated :)
|
|
|  |
 |

Dave
Staff
/ Moderator

Jun 9, 2008, 11:27 AM
Post #2 of 3
(275 views)
Shortcut
|
|
Re: [AgentBristow] Displaying list view in columns
[In reply to]
|
Can't Post
|
|
No problem. The trick with any kind of design you want to create is to first create a mockup, then to figure out what the pattern is. Try this code. It will output a </tr><tr> after every 2 <td>...</td> lines:
<table border="1"> <tr> <?php foreach ($records as $record): ?> <td> <?php echo $record['title'] ?><br/> </td> <?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?> <?php endforeach; ?> </tr> </table> Note that you should use your own variable names instead of $record, etc but that the line in red can stay the same. Let me know if that works for you. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

_kate_
User

Jun 23, 2008, 11:14 AM
Post #3 of 3
(222 views)
Shortcut
|
|
Re: [Dave] Displaying list view in columns
[In reply to]
|
Can't Post
|
|
Worked perfectly! Thanks! :)
|
|
|  |
|