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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:05:02+00:00 2026-06-18T09:05:02+00:00

I have been told several times that I shouldn’t be using tables for layout

  • 0

I have been told several times that I shouldn’t be using tables for layout design but I constantly find myself going back to them when I can’t figure out how to do something.

I need to create a two column layout. The left column is 300px width and the right column takes up the rest of the width on the page. I can’t figure out how to properly do this with plain HTML and I can’t even quite figure out how to do it with a table either.

In order to have the right column take up the rest of the width it seems that I would need to specify the left column’s width with a percentage so that the right column’s width can be 100% less the percentage of the left column. But I need the left column to be 300px exactly.

The only thing I can think to do is calculate the right column’s width at runtime with JS. Any ideas how I can accomplish this without tables and/or without Javascript?

  • 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-18T09:05:03+00:00Added an answer on June 18, 2026 at 9:05 am

    Until we have flexbox layout I would use absolute positioning:

    Html:

    <div id="container">
        <div id="left">left one</div>
        <div id="right">right one</div>
    </div>
    

    CSS:

    #container {
        position: relative;
        height: 150px;
    }
    
    #left, #right {
        position: absolute;
        top: 0px; 
        bottom: 0px;
    }
    
    #left {
        left: 0px; 
        width: 300px;
        background: red;
    }
    
    #right {
        left: 300px; 
        right: 0px;    
        background: green;
    }
    

    jsfiddle

    There are alternatives if you want the layout to adapt to the content instead of the container. If your right column has more content you could use:

    #container {
        position: relative;
    }
    
    #left {
        position: absolute;
        left: 0px; 
        width: 300px;
        top: 0px; bottom: 0px;
        background: red;
    }
    
    #right {
        margin-left : 300px; 
        background: green;
    }
    

    jsfiddle

    If your left column has more content, use:

    #container {
        position: relative;
    }
    
    #left {
        width: 300px;
        background: red;
    }
    
    #right {
        position: absolute;
        left: 300px; 
        right: 0px;
        top: 0px; bottom: 0px;
        background: green;
    }
    

    jsfiddle

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

Sidebar

Related Questions

I am building a web application and have been told that using object oriented
I have been told several definitions for it, looked on Wikipedia, but as a
Having read up on it and having been told off several times for using
I have been told that the Provider pattern is a way to design loosely
I have been told that a handle is sort of a pointer, but not,
I've been told several times that I should consider splitting parts of my app
i have been told to use 'when' statement to make multiplexer but not use
I have been told that Eclipse is a good tool for programming in certain
I have some transitive dependencies in my database design. I have been told by
I'm confused about this. Most of us have been told that there isn't any

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.