Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:06:48+00:00 2026-05-26T12:06:48+00:00

I am sure the title is not even right on this one. Here is

  • 0

I am sure the title is not even right on this one.
Here is the issue , I have 3 columns and 6 results
that are displayed like this

Column1           Column2             Column3
result1           result3             result5
result2           result4             result6

but need them like this

Column1           Column2             Column3
result1           result2             result3
result4           result5             result6

my array holds all 6 results and so far I see I need to pick every 0 and 2nd to be displayed in column1 and continue( array starts at 0).

the code is pretty large but the main part for switching results is here

$count = count($result);
for ($result = 0; $result < $count; $result++) {
                    $getorder= "";
                    if ($count != 1) {
                        if ($result == 0) $getorder= "first";
                        if ($result == $count - 1) $getorder= "last";
                    }


    echo '<div class="'.$getorder.'width'.intval(100 / $count).'">'.$mycolumn[$result].'</div>';
}

so this here should have some kind of division. Here is just dumb example

$mycolumn[$result % X == X]

i hope I did not confuse you and you get the idea. If you ask yourself why i don’t just do rows instead columns , answer is complete css reconstructions. whit this here figured out I can target the results and keep columns and css as they are

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:06:49+00:00Added an answer on May 26, 2026 at 12:06 pm

    Don’t use ($result / 3) since you can have seriuous rounding problem.
    Since to me it’s not very clear the name of your vars I post you a php generic code and it is:

    echo '<div class="result">';
    for($i = 0; $i < $columnNum; $i++)
    {
       echo '<div class="column">';
       for($j = $i; $j < $resultNum; $j += $columnNum)
          echo '<label class="value">' . array[j] . "</label>";
       echo '</div>';
    }
    echo '</div>';
    

    Just change the vars name with your needs and this is the solution to your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not sure if I have set the right title for this post
Ok so I'm not even sure how to title this post but I have
Not even really sure what kind of title this question needs. Basically I have
Not even sure if this is the right way to title the question. I
I'm not even sure what title to give this question; hopefully the code will
I'm not even sure about how to title this qn. But, hope there is
Ok, first of all, I'm not even sure the title is right, if so,
(I'm not sure exactly how to phrase the title here, and because of that
I am not sure my title is correct or not since I have no
Not sure the title fully describes the problem/question I'm trying to ask, sorry. One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.