I'm trying to figure out how to display a set of data in two columns, but I'm having some trouble figuring out how I'd code it. So I'm looking for help.
Basically, I have this page, here, that has 2 columns of data currently, but as you can see the data is the same. That's not what I want. What I want is for the data in the left column to be split in half, and put into the right column. I can't do it with static numbers because the amount of data changes for each day, so how do I do this?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Splitting Data into 2 columns
-
- Rank: Senior
- Registered: Sep 22, 2003
- Last visit: Oct 21, 2009
- Posts: 2774
The examples in this post:
http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=18547
...are for news stories, but you could take a look at the simple code and use the same techniques. There are two methods - the first puts each item in its own cell in a two-column format, the second (found on the second page of the thread "New and Improved" just makes a two column table and puts half the data in one and the other half in the other...
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info... -
- Rank: Senior
- Registered: Sep 22, 2003
- Last visit: Oct 21, 2009
- Posts: 2774
No, you just have a counter while you are looping through your results and add them to this column or that column based on if the count is even or odd... (Though it would necessarily have to be a GLOBAL var as it's all taking place in the same subroutine)
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info...
- Moderated by:
- Support
