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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:04:44+00:00 2026-05-22T21:04:44+00:00

The simplified content of my html page is: <body> <div id=container> <div class=header></div> <div

  • 0

The simplified content of my html page is:

<body>
    <div id="container">
        <div class="header"></div>                  
        <div class="main-content" style="float:none; align:center; text-align:center; margin:auto;">
            <table style="width: 2000px;">
                <tr>
                    <td>Some Content</td>
                </tr>
            </table>            
        </div>      
        <div class="footer">            
            <a href="#">EMS</a>
            </div>
    </div>
</body>

The .css:

html,
body {
 height: 100%;
 margin: 0px;
 padding: 0px;
}
body {
 font-family: "Liberation Sans",'Lucida Grande',Verdana,Arial,Helvetica, "Luxi Sans", "Bitstream Vera Sans", Tahoma,Sans-Serif;
 font-size: 90%;
 background: #FAFAFA;
 color: #333333; 
}
#container {
 background:#AEC7DB url('../main-bg-gradient.png') repeat-x top left;
 position: relative;
 min-height: 100%;
 width: 100%;
 height: 100%;
 margin: 0px;
 padding: 0px; 
 max-width: 100%; 
}
.main-content {
 position: relative;
 padding: 0px;
}
.footer {
 clear:both;
 font-family: Georgia,"Times New Roman",Times,serif;
 font-size: 90%;
 padding: 4px 0px 4px 0px;
 text-align: center;
}

As you can see I have added a table width 2000px. As because I will add there table dynamically. And this causes the deformation to the page. The div with id “container” is not covering its content. It is taking the size of my screen and rest of the portion in the left is white also there is a horizontal scrollbar as this is natural with 2000px table.

What I need is that the div with id “container” cover its whole content and the the div with id “header” remain fixed in its position if one scroll the page horizontally.

How can I achieve this?

Thank you.

  • 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-22T21:04:44+00:00Added an answer on May 22, 2026 at 9:04 pm

    The first solution is to change the width of #container from 100% to 2000px and remove max-width.

    Demo: http://jsfiddle.net/h3TQ3/

    A second solution is to remove max-width and width from #container and change position:relative to position:absolute

    Demo: http://jsfiddle.net/h3TQ3/1/

    To have your header in fixed position you can add the following css:

    .header {
        position: fixed;
        top: 0;
        width: 100%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simplified my page and here what I have: <html> <head> <meta http-equiv=content-type
I have a following HTML/CSS (simplified): <body> <style> body { margin: 0px; padding: 0px;
I'm using a file, page.php, as an HTML container for several content files; i.e.,
I have an order entry page and a corresponding ViewModel (simplified example): public class
I am currently building a small website where the content of the main div
In a simple web page I load some new HTML into a div using
I have the following HTML page (page is simplified here as it is a
Imagine I have the following code (simplified regarding my real context of course): <div
A simplified version of problem I am experiencing: Here is my HTML form: <form
Following simplified code snippet: #include <QtGui> int main(int argc, char **argv) { QApplication app(argc,

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.