Well you could mess with your CSS to change the positioning, or you could run a for loop to dump the data in the correct sequence (if I understand you right and you always want 2 rows).
Thank you, but I do not want to maintain just two rows. I want to keep vertical output like in my example but in 4 columns. This code in my post gives me horizontal structure.
For example array from my result set is letters from a-p. Right now i got this one:
a, b, c, d,
e, f, g, h,
i, j, k, l,
m, n, o, p
....
....
But I want display like this:
a e i m
b f j n
c g k o
d h l p
... etc
Yes m8 I've changed name of the field.. But I'm affraid that I must leave this approach and get back to simple tables even though I don't like them .. It's really confusing... And on the internet there's no such solutions.. It's possible somehow, but for me now it's mission impossible
OK I tested it out for you, I made a little error.I was multiplying the array index by the number of columns rather than the number of rows - I was almost there!
On a side note, don't expect everything to be done for you like this. Today was an exception in that I am quite bored and was intrigued by your problem.
Thank you very much for this, and I really didn't expect every part of code from you . I gave example in my first post to explain better what is my problem. And my problem was displaying the result tableless (with DIV's), but ok . Someone will need this code. And again thank you.
Well I only used tables for debugging purposes. The point of the script was to output data like that so it was compatible with your current CSS set up. I suggested from the start that you should leave your PHP code the same but just change the CSS so that the positioning is altered.