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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:41:19+00:00 2026-06-08T04:41:19+00:00

I have a table which is pulled from a MYSQL DB and users can

  • 0

I have a table which is “pulled” from a MYSQL DB and users can use the dropdown boxes and save to MYSQL. All of it works- but the table doesn’t fit the DIV and looks an awful mess. Is there a away I can have a horizontal scroll bar to scroll across the table?

How can I put this table in a table that is 1100×545 px …it will overflow, but it needs to fit the div. And I would like it to over flow horizontally

echo "<table style=\"float:left;\" width=\"130\" border=\"0\" >";
                foreach($Data as $Item => $Value) {
            if(!is_numeric($Item) && $Item !== "UserIDHere") {
                if($i == 0) {
                    $Unit = substr($Item, 0, 2);
                    $Assignment = substr($Item, 2, 2);
                    $Task = substr($Item, 4, 2);

                    echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$UArr[$Unit]."</p></td></tr>";
                    echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$AArr[substr($Item, 2, 2)]."</p></td></tr>";
                    echo "<tr><td width=\"60\">".$TArr[$Task]."</td><td width=\"50\">".DropDown($Item, $Value)."</td></tr>";

                }
                if($Unit !== substr($Item, 0, 2)) {
                    echo "</tr>";
                    echo "</tr>";
                    echo "<table style=\"float:left;\" width=\"150\" border=\"0\" >";
                    $Unit = substr($Item, 0, 2);
                    echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$UArr[substr($Item, 0, 2)]."</p></td></tr>";
                }
                if($Assignment !== substr($Item, 2, 2)) {
                    $Assignment = substr($Item, 2, 2);
                    echo "<tr style=\"text-align: center\"><td colspan=\"4\"><p>".$AArr[substr($Item, 2, 2)]."</p></td></tr>";
                }
                if($Task !== substr($Item, 4, 2)) {
                    $Task = substr($Item, 4, 2);
                    echo "<tr><td width=\"60\">".$TArr[$Task]."</td><td width=\"50\">".DropDown($Item, $Value)."</td></tr>";
                }
                $i++;
            }

        }
        echo "</table>";

The CSS of this is

.full-segment
{
    width: 1100px;
    height: 545px;
    overflow: scroll;
}

How do I make it so the overflow is horizontal ) so you slide horizontal and not vertically?

how it's looking

  • 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-08T04:41:22+00:00Added an answer on June 8, 2026 at 4:41 am

    Put the <div> outside the scope of the <table>. So your code should look like:

    echo "<div foo='bar' foo2='bar2'>
    <table foo='bar' foo2='bar2'>";
    //populate the table here
    echo "</table></div>";
    

    The default CSS setting of overflow:auto will take care of the rest.

    EDIT: The default CSS setting is not overflow:auto. It’s overflow:visible. My mistake. You need to declare overflow:auto explicitly in the style attribute.

    UPDATE: Making the fields go horizontally requires putting them into the same <tr> tags. Each different <tr> tag will result in a new row (on a new line) in the table. For that, you’ll want to rethink your grouping and how you’re placing those <tr> tags, and how many fields you want in one row. Unfortunately, that’s something you’ll have to experiment with yourself until you find the right look for you.

    Also, tables within tables, while they work, can cause loads of trouble if you don’t close them properly. You probably want to make sure that that piece of code is doing what you want it to do.

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

Sidebar

Related Questions

I have a table being pulled from MySql through PHP.. The TD in the
I have table which contains double values stored in mysql database ...I need to
I have table in which I am inserting rows for employee but next time
i have a table which has many fields but i want to get count
I have a table which i want to store all the outputs into one
I have a complex table pulled from a multi-ActiveRecord object array. This listing is
I have a page with a dynamic table, data pulled from a GET method.
I have one table which contains events and dates, and another which contains the
I have a table which stores the data related to posts in this format
I have a table which contains TV Guide data. In a simplified form, the

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.