jaxdevil Posted November 2, 2007 Share Posted November 2, 2007 I am trying to output my loop data into two columns, not duplicated in two columns but basicly like this.... first row second row third row forth row fifth row sixth row etc. As it is now my script querys my databse, grabs all the fields, and puts all the fields for id 1 on one line, then it loops to the next one and puts the next id's (id 2) fields all on the next line, and so on. I want to format the data in tables (well its already formated) but when it loops I don't want them being output one above the other I want the first id's data to display in one table, then next to it output the next line (line 2), then have it break to a new line, which will be the same, the first part of that one will be line3, then line 4. Any ideas? I have thought about maybe doing one loop statement for odd numbers and have hat display in a cell, keeping all of the odds on one side of the page, then doing even in a cell next to it which would have all the evens go on the opposite side of the page. The only problem is some of the fields are skipped since it pulls the data based on whether the id is active, etc. So that would end up being out of sequence. I want to be able to print the output to hardcopy and a person can read it going from left to right then down to the next line, left, and right, then down again, etc. but remaining the data in sequence so they see the ids and all the ids data as follows... ---------------------------------------------------- | | | | id1, name, date, etc. | id2, name, date, etc. | | | | |--------------------------------------------------- | | | | id3, name, date, etc. | id4, name, date, etc. | | | | |--------------------------------------------------- | | | | id5, name, date, etc. | id6, name, date, etc. | | | | |--------------------------------------------------- | | | | id7, name, date, etc. | id8, name, date, etc. | | | | |--------------------------------------------------- | | | | id9, name, date, etc. | id10, name, date, etc. | | | | |--------------------------------------------------- Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/75765-putting-loop-data-in-2-columns/ Share on other sites More sharing options...
rajivgonsalves Posted November 2, 2007 Share Posted November 2, 2007 code please Quote Link to comment https://forums.phpfreaks.com/topic/75765-putting-loop-data-in-2-columns/#findComment-383427 Share on other sites More sharing options...
Barand Posted November 2, 2007 Share Posted November 2, 2007 See FAQ section http://www.phpfreaks.com/forums/index.php/topic,95426.0.html Quote Link to comment https://forums.phpfreaks.com/topic/75765-putting-loop-data-in-2-columns/#findComment-383428 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.