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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:03:19+00:00 2026-06-14T17:03:19+00:00

Basically I am createing a unknown size of checkboxs that is dependent on the

  • 0

Basically I am createing a unknown size of checkboxs that is dependent on the row that is chosen from a table in my database. The reason I dont know the size is that the user chooses which row they will use with some rows containing what will become 10 checkboxs adn others containing as many as 75. So the problem is that if the user selects a row with a large amount of options it goes through the border of my div and then forces me to scroll the page down what I am looking for is a way to say >

if(number of checkboxs is >25 )

create a new column on my page

I dont know whether the right way to go about this is to use php or javascript or possibly do it using css I am new to all of these languages so any help no matter how trivial will greatly appreciated.

<div id="major1">
<?php   
        $courses=mysql_query("SELECT * FROM MAJORS_CHECKLIST WHERE MAJOR='$major'");
        $courses_row=mysql_fetch_row($courses);
        $count = 0;
        echo "$courses_row[0] <br/>";
        $checkit = 0;
        $sidebyside = 0;
        foreach($courses_row as $i=>$courses_row){
            if($courses_row['$count'] == NULL)
            {
                break;//if we run out of courses stop printing them

            }
            if($courses_row[$count] == $courses_row[0] && $checkit == 0 )
            {

                $checkit = $checkit + 1;
            }
            else
            {       
                echo "<input type='checkbox' value='$courses_row' name='majorCourses[]' />&nbsp;";//answer-$i
                echo "$courses_row<br /> ";

            }
            $count = $count + 1;
            /*$sidebyside++;
            if($sidebyside == 2)//tried using this to put 2 checkboxes side by side that ened up just messing everything up 
            {
                echo "<br/>";
                $sidebyside = 0;
            }*/ 
        }

?>

here is my css:

   #major1{
color: white;
/*border: 1px solid black;*/
padding: 5px;
float: left;
height:500px;
width:150px;
}
  • 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-06-14T17:03:23+00:00Added an answer on June 14, 2026 at 5:03 pm

    Producing a bunch of checkboxes in the div can be controlled using CSS. Should set the parent div of the checkboxes to the following rules: width:auto; height:auto; padding:10px 10px; position:relative; This is all assuming that the parent div of the checkboxes is a child of another div to control the preferred dimensions

    edit: if you do not want to want to use css with the methods above, you can control the “X” amount of checkboxes per row. You can create a counter to count how many are being displayed and do a if($counter % X == 0) echo “</div><div>“; This is all assuming you have a starting div at the beginning of your code and an ending div at the end of the code.

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

Sidebar

Related Questions

Basically I am creating a dynamic google map that pulls information from the database,
I am basically creating an iphone app that get's it's data from wordpress. Wordpress
Basically I am creating a database driven website in Web Developer 2008. The database
I just need help. Basically I am creating a windows appllication that sends bulk
Basically, I am creating an XML file by taking the values from a column
I am creating an application that basically places a drawable into an imageView onClick.
So i have been creating this framework thing that basically puts together source code
I am basically creating an API in php, and one of the parameters that
I have been given a new task from the client which is basically creating
From my understanding the Adapter pattern is basically creating a wrapper on another class

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.