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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 168k
  • Answers 169k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The following C# code shows how to do this (sorry,… May 12, 2026 at 1:49 pm
  • Editorial Team
    Editorial Team added an answer If you had wanted to do it for an unnamed… May 12, 2026 at 1:49 pm
  • Editorial Team
    Editorial Team added an answer Best way to serialize the date in javascript is to… May 12, 2026 at 1:49 pm

Related Questions

I'm trying to parse an array of JSON objects into an array of strings
I am trying to parse Twitter RSS feeds and put the information in a
In my Seam application, I have a Seam component that returns a ( @Datamodel
I have a C# collection of strings. Each string is a sentence that can

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.