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 262705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:32:24+00:00 2026-05-11T22:32:24+00:00

The problem is to split a list of items into a variable number of

  • 0

The problem is to split a list of items into a variable number of columns to maximize the display on the web page ( note, they are displayed from left to right )

If there are 15 items in the list, they go in one column
if there are 20 items on the list, they go in two columns
if there are 30 items on the list, they go in two columns
there can be max 8 columns to eliminate horiz. scrolling

again, the goal is to maximize the display which accounts for the slight inconsistency above
to determine the # of columns, i could use a variation of the code
if ( cnt > 100, col = 8 ) else if ( cnt > 60 col = 5 )…. etc.
but i hope there’s a better formula for determing the column count ?

the output would be of the form

1   2   3   4   5   6   7
8   9   10  11  12  13  14
15  16  17  18  19  20  21
22  23  24  25  26  27  28
29  30  31  32  33  34  35
36  37  38  39  40  41  42
43  44  45  46  47  48  49
50  51  ........

hope the problem is clear, any questions let me know

  • 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-11T22:32:25+00:00Added an answer on May 11, 2026 at 10:32 pm
    if count > 15
       cols = count / ITEMS-PER-COL
    if cols > 8
       cols = 8
    

    does this seem like it ??

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

Sidebar

Related Questions

Really simple problem: I want to split a connection string into its keyword /
Possible Duplicate: How do you split a list into evenly sized chunks in Python?
OSGi has a problem with split packages, i.e. same package but hosted in multiple
Problem: Given a list of strings, find the substring which, if subtracted from the
I crossed uppon a weird problem. I have a list with links like so:
My current project is split into multiple classes that correctly represent the way we
I have a custom built web service that is built to simply add items
It is hard to put this problem into words, but a real world example
I'm creating a list of items from a file BufferedReader reader = new BufferedReader(
I have run into an odd problem in my django application where a for

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.